[dmd-internals] Errors emitted by the optimizer and the as-if rule

Jonathan M Davis jmdavisProg at gmx.com
Mon Aug 20 13:29:45 PDT 2012


On Monday, August 20, 2012 20:50:10 David Nadlinger wrote:
> On Mon, Aug 20, 2012 at 8:33 PM, Jonathan M Davis <jmdavisProg at gmx.com> 
wrote:
> > Because of -w, there is essentially zero difference between a warning and
> > an error except whether everyone sees it or not.
> 
> This is not true, see your favorite C compiler's "warnings-as-errors"
> switch. Warnings are precisely intended for cases where the code is
> legal, but likely to be wrong or error-prone.

It doesn't really matter what C does. Because dmd has -w, which makes warnings 
errors, and I believe that Phobos is compiled with it, _nothing_ can be a 
warning if it's ever the case that it's truly reasonable to leave it as-is. If 
it's a warning, it needs to be fixed. It might not be as critical as an error, 
but since -w makes it an error, there's ultimately not much difference.

- Jonathan M Davis


More information about the dmd-internals mailing list