score: ignore -Wdanglingpointer= in _User_extensions_Iterate

This commit is contained in:
Gedare Bloom
2024-10-28 23:11:06 -06:00
parent 6ae5a04766
commit 80ef0dee02

View File

@@ -202,12 +202,24 @@ void _User_extensions_Iterate(
_User_extensions_Acquire( &lock_context );
/*
* Ignore this warning:
*
* - storing the address of local variable 'iter' ... [-Wdangling-pointer=]
*
* We store the local variable &iter.Iterator here on the
* &User_extensions_List.Iterators, and then remove it from the list below
* at the call to _Chain_Iterator_destroy(). So it is not left dangling.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-pointer="
_Chain_Iterator_initialize(
&_User_extensions_List.Active,
&_User_extensions_List.Iterators,
&iter.Iterator,
direction
);
#pragma GCC diagnostic pop
if ( executing != NULL ) {
iter.previous = executing->last_user_extensions_iterator;