"Walter Bright" <newshou...@digitalmars.com> wrote in message news:hadbml$1mb...@digitalmars.com... > Nick Sabalausky wrote: >> "Compiler now detects some cases of illegal null dereferencing when >> compiled with -O" >> >> A bug-detection feature that's turned on with -O? I assume that's just a >> temporary situation and is related to either it currently being detected >> by the optimizer and the feature maybe being in a "trial" phase? Or maybe >> just a typo? ;) > > No, it's deliberate. Turns out, in order for it to work reliably and not > give false positives, it needs the full attention of the optimizer. > Otherwise, you get false positives like: > > int* p = null; > ... > if (p) > *p = 7; >
I see, but is that just a temporary situation? I'm fine with it for now, but optimizers are known for conflicting with debugging, so in the long run I'd hate to have to split my debug builds into separate "maximum static analysis" vs "debuggable" builds (I already had been forced to split my debug builds into separate "debug with warnings" and "debug without warnings" builds, which was a real pain in the ass until I started hacking in that "optionally treat warnings as warnings" patch...but I've had to temporarily abandon use of even that since I'm working on a multi-build-version tool, used by some projects I've released, and none of those should have to be reliant on a feature that only exists in a custom build of DMD).