public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] help with warnings and gcc-4.3.0
@ 2008-05-29 16:31 Kumar Gala
  2008-05-29 16:44 ` Scott Wood
  0 siblings, 1 reply; 2+ messages in thread
From: Kumar Gala @ 2008-05-29 16:31 UTC (permalink / raw)
  To: u-boot

I'm building with a native ppc compiler (fedora 9 install) and I get:

dlmalloc.c:2444: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2483: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2483: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c: In function 'realloc':
dlmalloc.c:2594: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2599: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2604: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2605: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2637: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2646: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2647: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c: In function 'calloc':
dlmalloc.c:2896: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2897: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c: In function 'malloc_trim':
dlmalloc.c:2987: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2997: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:3008: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:3012: warning: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:3021: warning: dereferencing type-punned pointer will break  
strict-aliasing rules

The warnings seem to come from:

#define bin_at(i)      ((mbinptr)((char*)&(av_[2*(i) + 2]) - 2*SIZE_SZ))
#define next_bin(b)    ((mbinptr)((char*)(b) + 2 * sizeof(mbinptr)))
#define prev_bin(b)    ((mbinptr)((char*)(b) - 2 * sizeof(mbinptr)))
..

#define top            (bin_at(0)->fd)   /* The topmost chunk */
#define last_remainder (bin_at(1))       /* remainder from last split */


but I can't seem to do anything to bin_at() to make them stop.  Was  
wondering if anyone had any suggestions.

- k

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot-Users] help with warnings and gcc-4.3.0
  2008-05-29 16:31 [U-Boot-Users] help with warnings and gcc-4.3.0 Kumar Gala
@ 2008-05-29 16:44 ` Scott Wood
  0 siblings, 0 replies; 2+ messages in thread
From: Scott Wood @ 2008-05-29 16:44 UTC (permalink / raw)
  To: u-boot

On Thu, May 29, 2008 at 11:31:28AM -0500, Kumar Gala wrote:
> #define bin_at(i)      ((mbinptr)((char*)&(av_[2*(i) + 2]) - 2*SIZE_SZ))
> #define next_bin(b)    ((mbinptr)((char*)(b) + 2 * sizeof(mbinptr)))
> #define prev_bin(b)    ((mbinptr)((char*)(b) - 2 * sizeof(mbinptr)))
> ..
> 
> #define top            (bin_at(0)->fd)   /* The topmost chunk */
> #define last_remainder (bin_at(1))       /* remainder from last split */
> 
> 
> but I can't seem to do anything to bin_at() to make them stop.  Was  
> wondering if anyone had any suggestions.

We could compile that file with -fno-strict-aliasing, which is probably
warranted anyway for the kind of pointer manipulation that malloc needs to
do.

-Scott

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-29 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-29 16:31 [U-Boot-Users] help with warnings and gcc-4.3.0 Kumar Gala
2008-05-29 16:44 ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox