[U-Boot-Users] HELP, trying to remove complier warnings

Kumar Gala galak at kernel.crashing.org
Thu Jul 10 18:58:30 CEST 2008


I'm running with gcc-4.3 from fedora 9.  I get the following warnings:

dlmalloc.c: In function ‘malloc_extend_top’:
dlmalloc.c:1971: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:1999: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2029: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2031: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2042: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c: In function ‘malloc’:
dlmalloc.c:2245: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2245: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2253: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2258: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2263: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2318: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2327: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2329: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2344: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2356: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2360: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2362: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2363: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c: In function ‘free’:
dlmalloc.c:2431: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2444: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2483: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2483: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c: In function ‘realloc’:
dlmalloc.c:2594: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2599: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2604: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2605: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2637: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2646: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2647: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c: In function ‘calloc’:
dlmalloc.c:2896: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2897: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c: In function ‘malloc_trim’:
dlmalloc.c:2987: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:2997: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:3008: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:3012: error: dereferencing type-punned pointer will break  
strict-aliasing rules
dlmalloc.c:3021: error: dereferencing type-punned pointer will break  
strict-aliasing rules

They all result from the bin_at macro in the file.  I can't seem to do  
anything to the code to get rid of them.

I see these both on x86 or ppc host builds:

x86:

gcc -g  -Os -m32    -D__KERNEL__ -DTEXT_BASE=0x387c0000 -I/local/home/ 
galak/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem / 
usr/lib/gcc/x86_64-redhat-linux/4.3.0/include -pipe  -DCONFIG_I386 - 
D__I386__ -march=i386 -Werror -Wall -Wstrict-prototypes -fno-stack- 
protector -c -o dlmalloc.o dlmalloc.c

ppc:

gcc -g  -Os   -fPIC -ffixed-r14 -meabi -D__KERNEL__ - 
DTEXT_BASE=0xeff80000 -I/local/home/galak/git/u-boot-85xx/include -fno- 
builtin -ffreestanding -nostdinc -isystem /usr/lib/gcc/ppc64-redhat- 
linux/4.3.0/include -pipe  -DCONFIG_PPC -D__powerpc__ -DCONFIG_MPC85xx  
-DCONFIG_E500 -ffixed-r2 -Wa,-me500 -msoft-float -mno-string -mno-spe - 
DCONFIG_E500=1 -DCONFIG_MPC85xx=1 -DCONFIG_PPC_P4080=1 -Wall -Wstrict- 
prototypes -fno-stack-protector  -c -o dlmalloc.o dlmalloc.c

- k	




More information about the U-Boot mailing list