[RTEMS Project] #4662: Fix GCC 12 warnings

RTEMS trac trac at rtems.org
Wed Aug 3 07:18:28 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 would prefer not to have to touch this trail:
 {{{
 ../../../cpukit/score/src/percpudata.c: In function
 '_Per_CPU_Data_initialize':
 ../../../cpukit/score/src/percpudata.c:88:7: warning: 'memcpy' offset 0 is
 out of the bounds [0, 0] of object '_Linker_set__Per_CPU_Data_begin' with
 type 'char[0]' [-Warray-bounds]
    88 |       memcpy( cpu->data, RTEMS_LINKER_SET_BEGIN( _Per_CPU_Data ),
 size);
       |
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 In file included from ../../../cpukit/include/rtems/score/percpudata.h:41,
                  from ../../../cpukit/score/src/percpudata.c:41:
 ../../../cpukit/include/rtems/linkersets.h:38:3: note:
 '_Linker_set__Per_CPU_Data_begin' declared here
    38 |   _Linker_set_##set##_begin
       |   ^~~~~~~~~~~~
 ../../../cpukit/include/rtems/linkersets.h:95:39: note: in expansion of
 macro 'RTEMS_LINKER_SET_BEGIN'
    95 |   RTEMS_LINKER_SET_ALIGN( type ) type RTEMS_LINKER_SET_BEGIN( set
 )[ 0 ] \
       |                                       ^~~~~~~~~~~~~~~~~~~~~~
 ../../../cpukit/score/src/percpudata.c:49:1: note: in expansion of macro
 'RTEMS_LINKER_RWSET'
    49 | RTEMS_LINKER_RWSET(
       | ^~~~~~~~~~~~~~~~~~
 }}}
 Built with `config.ini`:
 {{{
 [DEFAULT]
 RTEMS_DEBUG = True
 RTEMS_POSIX_API = True

 [arm/xilinx_zynq_a9_qemu]
 RTEMS_SMP = True
 BUILD_TESTS = True

 }}}

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


More information about the bugs mailing list