diff --git a/testsuites/validation/tx-thread-queue.c b/testsuites/validation/tx-thread-queue.c index 9d930c52dc..23e9878b90 100644 --- a/testsuites/validation/tx-thread-queue.c +++ b/testsuites/validation/tx-thread-queue.c @@ -285,10 +285,20 @@ static void ThreadQueueDeadlock( longjmp( ctx->before_enqueue, 1 ); } +/* + * This warning flags when the caller of setjmp() is assuming a local + * variable survives the longjmp() back. In this specific case, this + * assumption is OK because it never returns from the thread body and + * the variable "events" is preserved. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclobbered" + static void Worker( rtems_task_argument arg, TQWorkerKind worker ) { TQContext *ctx; + ctx = (TQContext *) arg; while ( true ) { @@ -445,6 +455,8 @@ static void Worker( rtems_task_argument arg, TQWorkerKind worker ) } } +#pragma GCC diagnostic pop + static void BlockerA( rtems_task_argument arg ) { Worker( arg, TQ_BLOCKER_A );