Re: Where did the warning go?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Eivind LM" <eivliste@xxxxxxxxx> writes:

> On Mon, 23 Feb 2009 21:39:18 +0100, Ian Lance Taylor <iant@xxxxxxxxxx>
> wrote:
>
>> "Eivind LM" <eivliste@xxxxxxxxx> writes:
>>
>>> Next question: Does the -Wall flag have a long and complicated history?
>>
>> No, though certainly the details have changed over time.
>
> So the flag enables a subset of all warnings, and the collection
> changes  over time. Why don't the name reflect that? I think Eljay's
> suggested name  "-Wselect-popular-warnings" was excellent.

The name -Wall was chosen some 20 years ago.  Perhaps it was a mistake,
however it was decided, and documented, and has been used successfully,
for a long time.  I think it would take a very persuasive argument to
change it now.  That argument would need to be more than merely "the
name doesn't seem right for what it does."  You need to consider the
cost of changing all the Makefiles out there which use it, and the
benefits of making the change.


> It does of course depend on each case whether a warning is easy to
> avoid  or not, and also if it warns about a real problem or not. But
> in any case,  a warning can help me write code that more surely will
> do what I intend.  For example the following code is not doing what I
> intended:
>
>   #include <stdio.h>
>   void print(int a) { printf("%d\n", a); };
>   int main() { print(2.5); return 0; };
>
> I think the problem in the code is both easy to avoid and serious, but
> I  get no warning with -Wall and -Wextra (g++ 4.3).
> 
> Instead of adding -Wconversion (and to search for any other flags I
> might  find useful, but that I don't know of yet), I would rather
> compile my  project with something like "-Weverything" from the
> beginning, and then  disable the warnings that turns out to not fit my
> programming style.

I think the issue here is that there is disagreement about whether the
-Wconversion warnings rise to the level of being questionable.  It would
be reasonable to propose having -Wconversion under -Wall, if you want to
send in a proposed patch.  It might be interesting to try building some
packages with such a change, notably gcc itself.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux