From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] warnings from gcc-4.4 build
Date: Wed, 01 Jul 2009 15:53:24 +0200 [thread overview]
Message-ID: <m263ectsq3.fsf@ohwell.denx.de> (raw)
In-Reply-To: <9B5E5AE1-2907-49C2-870F-2D7B2F2DE598@kernel.crashing.org> (Kumar Gala's message of "Tue, 30 Jun 2009 10:28:25 -0500")
Hi Kumar,
> When building the MPC8572DS_config w/gcc-4.4 I get:
>
> sys_eeprom.c: In function ?do_mac?:
> sys_eeprom.c:323: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> sys_eeprom.c: In function ?mac_read_from_eeprom?:
> sys_eeprom.c:395: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> ahci.c: In function ?ata_scsiop_read_capacity10?:
> ahci.c:616: warning: dereferencing type-punned pointer will break
> strict-aliasing rules
> biosemu.c: In function ?BE_setVGA?:
> biosemu.c:147: warning: dereferencing type-punned pointer will break
> strict-aliasing rules
> tsec.c: In function ?tsec_init?:
> tsec.c:200: warning: dereferencing type-punned pointer will break
> strict-aliasing rules
> dlmalloc.c: In function ?malloc_bin_reloc?:
> dlmalloc.c:1502: warning: dereferencing pointer ?p? does break strict-
> aliasing rules
> dlmalloc.c:1502: warning: dereferencing pointer ?p? does break strict-
> aliasing rules
> dlmalloc.c:1499: note: initialized from here
> dlmalloc.c:1502: note: initialized from here
> dlmalloc.c: In function ?free?:
> dlmalloc.c:2474: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2474: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2474: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2474: note: initialized from here
> dlmalloc.c: In function ?malloc?:
> dlmalloc.c:2219: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2219: note: initialized from here
> dlmalloc.c:2228: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2228: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2228: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2228: note: initialized from here
> dlmalloc.c:2235: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2235: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2235: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2235: note: initialized from here
> dlmalloc.c:2292: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2292: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2292: warning: dereferencing pointer ?({anonymous})? does
> break strict-aliasing rules
> dlmalloc.c:2292: note: initialized from here
You already fixed quite a few problems in dlmalloc:
commit 57c219ad5d34dd9d49991777a62e3899595f2ec7
Author: Kumar Gala <galak@kernel.crashing.org>
Date: Wed Jul 30 08:01:15 2008 -0500
Fix compile warnings in dlmalloc
The origional code was using on odd reference to get to the first
real element in av_[]. The first two elements of the array are
not used for actual bins, but for house keeping. If we are more
explicit about how use the first few elements we can get rid of the
warnings:
dlmalloc.c: In function 'malloc_extend_top':
dlmalloc.c:1971: warning: dereferencing type-punned pointer will break strict-aliasing rules
dlmalloc.c:1999: warning: dereferencing type-punned pointer will break strict-aliasing rules
dlmalloc.c:2029: warning: dereferencing type-punned pointer will break strict-aliasing rules
...
The logic of how this code came to be is:
bin_at(0) = (char*)&(av_[2]) - 2*SIZE_SZ
SIZE_SZ is the size of pointer, and av_ is arry of pointers so:
bin_at(0) = &(av_[0])
Going from there to bin_at(0)->fd or bin_at(0)->size should be straight forward.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> xyzModem.c: In function ?xyzModem_stream_open?:
> xyzModem.c:564: warning: ?dummy? is used uninitialized in this function
> xyzModem.c:547: note: ?dummy? was declared here
>
> Should would be turning on -fno-strict-aliasing. The linux kernel has
> been doing this for some time.
Last time around, i.e. moving to gcc 4.x (as proven by the commit
above), we were able to fix the problems. Did anything significantly
change in the arguments?
Cheers
Detlev
--
The mathematician's patterns, like the painter's or the poet's, must be
beautiful; the ideas, like the colours or the words, must fit together in a
harmonious way. Beauty is the first test: there is no permanent place in the
world for ugly mathematics. -- G. H. Hardy
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
next prev parent reply other threads:[~2009-07-01 13:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 15:28 [U-Boot] warnings from gcc-4.4 build Kumar Gala
2009-07-01 13:53 ` Detlev Zundel [this message]
2009-07-04 23:33 ` Wolfgang Denk
2009-07-06 15:10 ` Kumar Gala
2009-07-06 17:52 ` Scott Wood
2009-07-10 23:05 ` Wolfgang Denk
2009-07-11 2:49 ` Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m263ectsq3.fsf@ohwell.denx.de \
--to=dzu@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox