[RTEMS Project] #4662: Fix GCC 12 warnings

RTEMS trac trac at rtems.org
Wed Aug 3 10:18:25 UTC 2022


#4662: Fix GCC 12 warnings
-------------------------+---------------------
 Reporter:  Chris Johns  |       Owner:  (none)
     Type:  defect       |      Status:  new
 Priority:  normal       |   Milestone:  6.1
Component:  tool/gcc     |     Version:  6
 Severity:  blocker      |  Resolution:
 Keywords:               |  Blocked By:
 Blocking:               |
-------------------------+---------------------

Comment (by Chris Johns):

 I think this warning is due to the pointer being captured in a `static
 const` variable:
 {{{
 In file included from ../../../testsuites/libtests/ttest01/test-leak.c:1:
 ../../../cpukit/include/rtems/test.h: In function
 'T_case_body_missing_free':
 ../../../cpukit/include/rtems/test.h:225:9: warning: 'p' may be used
 uninitialized [-Wmaybe-uninitialized]
   225 |         T_check_not_null(&T_check_instance, a);
 \
       |         ^~~~~~~~~~~~~~~~
 ../../../cpukit/include/rtems/test.h:219:6: note: by argument 2 of type
 'const void *' to 'T_check_not_null' declared here
   219 | void T_check_not_null(const T_check_context_msg *, const void *);
       |      ^~~~~~~~~~~~~~~~
 }}}
 It should be OK so I am wondering if this is a false warning?

--
Ticket URL: <http://devel.rtems.org/ticket/4662#comment:9>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list