Should we warn if we detect null derefernces or void value uses ?

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 7 05:14:47 PST 2016


On 12/7/2016 4:40 AM, Jonathan M Davis via Digitalmars-d wrote:
> Warnings drive me nuts in C++ - especially with Visual Studio. It warns
> about all kinds of stupid stuff that makes no sense, much of which is
> perfectly valid C++ that gcc and clang don't complain about.

Warnings proliferate like bedbugs in C and C++ compilers because the vendors 
cannot fix the language, so they more or less invent their own language by 
generating warnings.

As you pointed out, though, each vendor produces a different set of warnings, 
and trying to make code "warning portable" can be an annoying exercise in 
frustration.

Standardizing warnings will never work, because that means modifying the 
language standard, but warning were invented as a workaround for not being able 
to modify the standard!

Note that the C and C++ Standards do not specify any warnings.

---------------------

Warnings are useful as a first step in a deprecation process, but when people 
debate a language restriction, cannot agree, and so compromise by generating a 
warning, things have failed.


More information about the Digitalmars-d mailing list