bug-coreutils
[Top][All Lists]
Advanced

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

Re: gcc warnings


From: Bruno Haible
Subject: Re: gcc warnings
Date: Wed, 11 Oct 2006 15:30:13 +0200
User-agent: KMail/1.9.1

Paul Eggert wrote:
> Coreutils has several other places where gcc -W issues
> bogus warnings (typically about signed vs unsigned comparisons)

Yes, "gcc -W" is practically unusable without -Wno-sign-compare.

> I think gcc -W ought to get fixed to match typical programming style,
> not the reverse.  Until this gets done we might as well not worry
> _too_ much about what gcc -W says.  "The compiler should be your
> servant, not your master."

I agree that "the compiler should be your servant". The
-Wmissing-field-initializers warning was put into gcc to help Linux
kernel programming; it has many structs with function pointers, and
an implicit NULL pointer there causes a crash, so it's really something
a Linux hacker wants to catch. You can't say it's not typical programming
style: the gnulib 'list' modules are written in the same style.

"gcc -W" is a collection of useful and of anal warnings. It was a
conscious decision of the gcc developers to put warnings that are
always useful into "gcc -Wall" and the remaining ones into "-W".
You can still use the warnings that bring most benefit one by one,
for example "gcc -Wall -Wmissing-field-initializers".

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]