Strict aliasing in D

ponce spam at spambox.com
Sat Jul 27 02:10:20 PDT 2013


On Saturday, 27 July 2013 at 09:05:32 UTC, ponce wrote:
> It would be great to have something like GCC's solution: warn 
> when pointer casts may violate the strict aliasing rule, and 
> provide a flag to disable it.

BTW, C++ compilers usually have an effective way to disambiguate 
pointer aliasing so that loop code generation is better.

restrict may helps, strict aliasing may helps, but in my 
experience a direct annotation "I know what I'm doing, this loop 
does not alias" or "no loop dependency" is often more effective. 
This obviously require to trust the optimizing programmer a bit :)


More information about the Digitalmars-d mailing list