Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ongoing rump udf build failure - and strict-aliasing warnings generally



On Fri Jul 18 2008 at 11:13:46 +1000, Daniel Carosone wrote:
> I've been getting this failure for a couple of weeks now, which is
> worrying - clearly others aren't seeing the same thing.  some
> combination of compiler flags and gcc's heisen-warnings, I guess.
>
> This is when building udf as a rump.

You get this when you do -O2.  Currently (but not for long) rump defaults
to -O0, and your infamous compiler flags override it.

> /home/NetBSD/obj/p4/home/NetBSD/HEAD/src/tooldir.NetBSD-4.99.69-i386/bin/i386--netbsdelf-gcc
>  -O0 -g -Wno-pointer-sign -DUDF_READWRITE -DDEBUG -DDIAGNOSTIC -ffreestanding 
> -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
> -Wno-sign-compare -Wno-traditional -Wreturn-type -Wswitch -Wshadow 
> -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -std=gnu99  -Werror 
> -march=nocona -O2 -pipe -fstack-protector -Wstack-protector --param 
> ssp-buffer-size=1  -I/home/NetBSD/HEAD/src/sys/rump/include  
> -I/home/NetBSD/HEAD/src/sys/rump/fs/lib/libudf -I. -D_KERNEL 
> -I/home/NetBSD/HEAD/src/common/include -D_RUMPKERNEL -nostdinc 
> -I/home/NetBSD/HEAD/src/sys   -nostdinc -isystem 
> /home/NetBSD/obj/p4/home/NetBSD/HEAD/src/destdir.i386/usr/include -c    
> /home/NetBSD/HEAD/src/sys/fs/udf/udf_allocation.c -o udf_allocation.o
> 
> /home/NetBSD/HEAD/src/sys/fs/udf/udf_allocation.c:1568: warning: 
> dereferencing type-punned pointer will break strict-aliasing rules
> 
> In the course of investigating this, I was concerned to learn that we
> seem to have disabled this warning for the kernel generally.  This
> leads to these kinds of problems creeping in undetected, until they
> crawl out from under that rock when built separately like this.  

I know you can "fix" these by casting to (void *) instead of (foo **),
but nobody has ever succesfully been able to explain to me a) what the
warning really really means and b) how to really fix it.


Home | Main Index | Thread Index | Old Index