[RTEMS Project] #4662: Fix GCC 12 warnings

RTEMS trac trac at rtems.org
Tue Feb 7 16:30:27 UTC 2023


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

Comment (by Zhongjie Zhu <zhongjiezhu1@…>):

 In [changeset:"ebb9e8c0a601bd089a56f637ed22a6be14ae8042/rtems"
 ebb9e8c/rtems]:
 {{{
 #!CommitTicketReference repository="rtems"
 revision="ebb9e8c0a601bd089a56f637ed22a6be14ae8042"
 score: Fix maybe uninitialized warning

 There are different cases for _ISR_lock_ISR_disable() and
 _ISR_lock_ISR_enable() in the case RTEMS_SMP is defined or
 RTEMS_PROFILING is defined, so remove the related code.

 ../../../cpukit/include/rtems/score/threaddispatch.h: In function
 '_Thread_Dispatch_disable':
 ../../../cpukit/include/rtems/score/threaddispatch.h:231:14: warning:
 'lock_context' may be used uninitialized [-Wmaybe-uninitialized]
   231 |   cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
       |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ../../../cpukit/include/rtems/score/threaddispatch.h:210:32: note: by
 argument 1 of type 'const ISR_lock_Context *' to
 '_Thread_Dispatch_disable_critical' declared here
   210 | static inline Per_CPU_Control *_Thread_Dispatch_disable_critical(
       |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ../../../cpukit/include/rtems/score/threaddispatch.h:225:21: note:
 'lock_context' declared here
   225 |   ISR_lock_Context  lock_context;
       |                     ^~~~~~~~~~~~

 Update #4662.
 }}}

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


More information about the bugs mailing list