March 14, 2005 warning bug - assertions | ||||
---|---|---|---|---|
| ||||
Assertions should probably be treated as no-ops:
warnassert.d:
> int main()
> {
> assert(0);
> return 0;
> }
warning - warnassert.d(4): statement is not reachable
And it doesn't matter if you use "-release" or not ?
--anders
|
March 18, 2005 Re: warning bug - assertions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anders F Björklund | > Assertions should probably be treated as no-ops: > > warnassert.d: > >> int main() >> { >> assert(0); >> return 0; >> } > > > warning - warnassert.d(4): statement is not reachable > > And it doesn't matter if you use "-release" or not ? This, once again, makes the new DMD 0.119 fail to compile with warnings enabled - due to "assert(0)" before reaching the statement with the return value... See http://www.algonet.se/~afb/d/dmd-0.119-dwarn.patch (new), and http://www.algonet.se/~afb/d/dmd-0.118-dwarn.patch (old) I used the workaround of changing the "assert(0);" into "debug assert(0);". It really doesn't matter, since the default Phobos build strips all assertions... (I added a libphobos-contracts.a to the RPMS I built) IMHO; Phobos should compile with all warnings enabled ? -anders |
Copyright © 1999-2021 by the D Language Foundation