assume, assert, enforce, @safe

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 30 17:29:47 PDT 2014


On 7/30/14, 4:51 PM, Tobias Müller wrote:
> With relatively 'dumb' compilers, this is not a big problem, but optimizers
> are more and more clever and will take profit of such assumptions if they
> can.

That's true, and it seems like a growing trend. Relevant threads:

https://groups.google.com/a/isocpp.org/forum/#!topic/std-proposals/9S5jNRW-5wY

http://www.spinics.net/lists/gcchelp/msg41714.html

Recent versions of gcc and clang have become increasingly aggressive 
about optimizing code by taking advantage of making undefined behavior 
_really_ undefined. There's been a couple of posts in the news recently 
that I can't find at the moment.


Andrei



More information about the Digitalmars-d mailing list