On Sun, May 4, 2008 at 11:16 PM, David Cournapeau < [EMAIL PROTECTED]> wrote:
> Charles R Harris wrote: > > > > > As far as I can tell, strict aliasing assumes that pointers are only > > cast between types of the same length. > > Strictly speaking, strict aliasing just says that locations pointed by > pointers do not alias. If you use two pointers of different types, > that's one case where the compiler will always assume they do not alias. Interesting article. I note that it is OK to alias pointers to the signed and unsigned versions of integer types, which is where I must have picked up my notions about length. I don't recall seeing any major bit of software that didn't use the -fno-strict-aliasing flag, as casting pointers around is one of the things C is(was) all about. So I was a bit surprised that Mike was recommending not doing so, although making the choice on a file by file basis might be useful for the optimizer. But the assumption of pointers and aliasing is so built into the whole C outlook that I wouldn't be surprised if any large program developed obscure bugs when compiled with the strict-aliasing flag. Chuck
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion