DIP(?) Warning to facilitate porting to other archs

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Fri May 2 18:17:23 PDT 2014


On Fri, 02 May 2014 22:39:12 +0000
Meta via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> On Friday, 2 May 2014 at 21:40:09 UTC, Jonathan M Davis via
> Digitalmars-d wrote:
> > True, that is a problem. But if folks really want the warnings,
> > they can go to the extra effort.
>
> Why are we making people go to extra effort to get lint-like
> functionality if we want it to be something that everyone uses?
> Whether a linter is a separate logical entity within the compiler
> or a library that can be hooked into, it should be on by default.

The problem that some of what gets warned about is _not_ actually a problem.
If it always were, it would be an error. So, unless you have control over
exactly what gets warned about and have the ability to disable the warning
in circumstances where it's wrong, it makes no sense to have the warnings,
because you're forced to treat them as errors and always "fix" them, even if
the fix is unnecessary. If the compiler provides that kind of control, then
fine, it can have warnings, but dmd doesn't and won't, because Walter doesn't
want it to have a vast assortment of flags to control anything (warnings
included). That being the case, it makes no sense to put the warnings in the
compiler. With a lint tool however, you can configure it however you want
(especially because there isn't necessarily one, official tool, making it
possible to have a lint tool that does exactly what you want for your
project). It's not tied to what the language itself requires, making it much
more sane as a tool for giving warnings. The compiler tends to have to do
what fits _everyone's_ use case, and that just doesn't work for warnings.

Putting warnings in the compiler always seems to result in forcing people to
change their code to make the compiler shut up about something that is
perfectly fine.

- Jonathan M Davis


More information about the Digitalmars-d mailing list