psxkey07/init.c: Add pragma for gcc 12 warning

Updates #4662
This commit is contained in:
Ryan Long
2022-08-16 12:06:05 -05:00
committed by Joel Sherrill
parent f60f349d86
commit f045b9ddd8

View File

@@ -56,8 +56,15 @@ rtems_task Test_Thread(rtems_task_argument argument)
value_p = malloc( sizeof( int ) );
rtems_test_assert(value_p != NULL);
sc = pthread_setspecific( Key, value_p );
rtems_test_assert( !sc );
/*
* This was added to address the following warning.
* warning: 'value_p' may be used uninitialized
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
sc = pthread_setspecific( Key, value_p );
#pragma GCC diagnostic pop
rtems_test_assert( !sc );
pthread_mutex_lock( &mutex1 );
++setted_thread_count;