From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier To: Tim Hollebeek Cc: Linus Torvalds , mark@codesourcery.com, rth@cygnus.com, craig@jcb-sc.com, davem@redhat.com, chip@perlsupport.com, egcs@egcs.cygnus.com Subject: Re: Linux and aliasing? Date: Wed, 30 Jun 1999 15:43:00 -0000 Message-ID: <19990607190440.B19375@pcep-jamie.cern.ch> References: <199906071936.MAA05494@franck.Princeton.EDU> X-SW-Source: 1999-06n/msg00266.html Message-ID: <19990630154300.yA5DkiHuma7dVd5dUDFCvTpZcaRzSJBjK2fItuHZNf0@z> Tim Hollebeek wrote: > This is going to happen even with the Torvalds hack. If they are > writing code that ignores the aliasing rules, not every single > instance will conform to the Torvalds "all pointer trickery happens in > a single expression" coding style. Hence their binary will still fail. > > Then we'll have to explain two things to them instead of just one: the > ANSI rules, and the extra Torvalds non-ANSI rules. Which is why we should make the compiler emit a warning for anything that _looks_ like it might break because of the aliasing rules. This will include some conforming code. Such is life. It can be disabled case by case -- just as you can write `if ((x & 1))' or `int x __attribute__ ((unused))' to disable some other useful warnings. My proposal for a type attribute handles this quite generally -- no Torvalds style required. have a nice day, -- Jamie