Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#489 closed defect (fixed)

libcsupport/src/newlib.c dereferencing type-punned pointer

Reported by: Ralf Corsepius Owned by: Joel Sherrill
Priority: highest Milestone: 2
Component: score Version: 4.6
Severity: critical Keywords:
Cc: bugs@…, ralf.corsepius@… Blocked By:
Blocking:

Description

gcc-3.3 produces this warning:

# i386-rtems4.7-gcc --pipe -DHAVE_CONFIG_H -isystem ../../../../pck6/lib/include -I../../../../../../../rtems.master/c/src/../../cpukit/libcsupport/src -mcpu=k6 -O4 -g -Wall -ansi -fasm -o o-optimize/newlibc.o -c ../../../../../../../rtems.master/c/src/../../cpukit/libcsupport/src/newlibc.c
../../../../../../../rtems.master/cpukit/libcsupport/src/newlibc.c: In function
`libc_init':
../../../../../../../rtems.master/cpukit/libcsupport/src/newlibc.c:267: warning: dereferencing type-punned pointer will break strict-aliasing rules

According to a disussion with gcc-developers this kind of
warning has to be taken very seriously. They originate from
gcc using -fstrict-aliasing, which is enabled by default in
gcc-3.3.x if using -O2 or greater.
If using -fstrict-aliasing with gcc-3.2 (Off by default),
gcc-3.2 also can break run-time behavior, but does't warn
about.

Release:
RTEMS-4.6 + RTEMS-CVS

How-To-Repeat:
Build RTEMS for a newlib-based target using gcc >= 3.3.

Attachments (1)

rtems-rc-20030913-1.diff (2.7 KB) - added by Ralf Corsepius on 12/03/06 at 13:31:13.
rtems-rc-20030913-1.diff

Download all attachments as: .zip

Change History (2)

comment:1 Changed on 09/15/03 at 09:55:48 by Ralf Corsepius

Status: assignedclosed

State-Changed-From-To: open->closed
State-Changed-Why: Patch applied to 4.6 and trunk

Changed on 12/03/06 at 13:31:13 by Ralf Corsepius

Attachment: rtems-rc-20030913-1.diff added

rtems-rc-20030913-1.diff

Note: See TracTickets for help on using tickets.