From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds To: Tim Hollebeek Cc: 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: References: <199906071936.MAA05494@franck.Princeton.EDU> X-SW-Source: 1999-06n/msg00267.html Message-ID: <19990630154300.FMawnhI_zEBclXMYEvErLwwfX9Um6aqXsk_SvwamV7Y@z> On Mon, 7 Jun 1999, 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. Yes. But it's less likely to fail. However, somebody else did suggest just a warning (for the "torvalds case" and potentially for other cases that are deemed suspect), and I certainly agree with that as a kind of "uhhuh, somebody is doing something dangerous". However, even then I think we'd _also_ need to have a syntactically cleaner way of fixing it - if a warning is generated it obviously would need to have some way of disabling the warning on a case-by-case basis (with either saying "it's ok to alias - don't warn me" or a "oh, you were right, this could alias, please consider it to be in alias set zero"). I completely agree with that kind of extension - it's obviously better than mine, but it's also much more ambitious than my quick and simple hack. > Then we'll have to explain two things to them instead of just one: the > ANSI rules, and the extra Torvalds non-ANSI rules. Just explain it as "dangerous code", and give examples. There are certainly bound to be other cases, although the "torvalds case" is the obvious and most common one. Linus