On Fri, Jul 18, 2008 at 06:40:22PM +0300, Antti Kantee wrote: > On Fri Jul 18 2008 at 17:40:05 +0300, Antti Kantee wrote: > > > > > > /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. > > Long discussion ensued offline. Thanks to the help of simon, apb, > martin et al, the conclusion was that this warning is bad (mm'kay) and > you should not randomly squelch it with void * casts since it breaks > caching assumptions that the compiler is allowed to make. That's all very well, and "bad, mm'kay" is about as much sense as that cryptic error message makes anyway. Therefore, surely it seems therefore that one should *also* not squelch it with blanket -Wno-* options either. So, do we have a brave volunteer who knows what he's doing to squelch them properly? -- Dan.
Description: PGP signature