mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
testsuites/validation/tx-call-within-isr.c: Address dangling pointer
On the genmcf548x BSP variants, the "request" local variable was flagged as having a pointer taken and passed to subroutines. GCC is unable to detect that the "request" variable is removed from the chain in an ISR. Disabled -Wdangling-pointer for the single test function CallWithinISR().
This commit is contained in:
committed by
Gedare Bloom
parent
ad60ce8c2c
commit
fa84f51442
@@ -107,6 +107,14 @@ static void CallWithinISRHandler( void *arg )
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* On some architectures, GCC gives a warning for a dangling pointer.
|
||||
* This is because "request" is a local variable and its address is
|
||||
* passed to another function. GCC cannot detect that "request" is
|
||||
* added to a chain in the foreground and removed in the ISR.
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdangling-pointer"
|
||||
void CallWithinISR( void ( *handler )( void * ), void *arg )
|
||||
{
|
||||
CallWithinISRRequest request;
|
||||
@@ -116,6 +124,7 @@ void CallWithinISR( void ( *handler )( void * ), void *arg )
|
||||
CallWithinISRSubmit( &request );
|
||||
CallWithinISRWait( &request );
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
void CallWithinISRSubmit( CallWithinISRRequest *request )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user