assert semantic change proposal

Daniel Gibson via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 3 18:26:10 PDT 2014


Am 04.08.2014 03:17, schrieb John Carter:
> As you get...
>
> * more and more optimization passes that rely on asserts,
> * in particular pre and post condition asserts within the standard
> libraries,
> * you are going to have flocks of user code that used to compile without
> warning
> * and ran without any known defect...
>
> ...suddenly spewing error messages and warnings.
>
> But that's OK.
>
> Because I bet 99.999% of those warnings will be pointing straight at
> bone fide defects.
>

Well, that would make the problem more acceptable..
However, it has been argued that it's very hard to warn about code that 
will be eliminated, because that code often only become dead or 
redundant due to inlining, template instantiation, mixin, ... and you 
can't warn in those cases.
So I doubt that the compiler will warn every time it removes checks that 
are considered superfluous because of a preceding assert().

Cheers,
Daniel


More information about the Digitalmars-d mailing list