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

Re: Using -Werror in CFLAGS for a debian package build



On Mon, May 16, 2011 at 05:04:07PM -0700, Russ Allbery wrote:
> Wouter Verhelst <wouter@debian.org> writes:
> 
> > What I didn't notice immediately was that gcc was emitting some
> > warnings, but that the -Werror option was not honored for those
> > warnings. Investigating turned up #615157 (Cc'd): the gcc maintainers
> > have decided to disable -Werror for some new warnings, because otherwise
> > it would cause FTBFS bugs in packages that have -Werror set in their
> > debian/rules file.
> 
> > IMHO, this is the wrong way to handle such things.
> 
> I was a bit dubious about it as well, for the reasons you state, but
> please note that GCC 4.6 introduced a major new warning about set but
> unused variables and, so far, every large or medium C code base that I
> have has had at least once instance of that warning.  And I'm usually
> pretty picky about such things.

Indeed; my own code runs into it as well. This is precisely why I'm
unhappy about it; when I write code, I want the compiler to complain,
loudly, when I do something dubious. When I build packages, I don't;
instead, I then want the compiler to just compile. The difference should
be in the CFLAGS that I pass it along, not in its defaults.

> If -Werror had not been disabled for this warning, my guess is that nearly
> every package using -Wall -Werror not previously tested with 4.6 would
> FTBFS.

Yes, and I think we should allow that to happen. If a maintainer chooses
to let their package fail because a new compiler version introduces new
warnings, then we should not be second-guessing their reasons like this.

I don't think it's smart for maintainers to use -Werror in their
packages; but if they, after having informed themselves, choose to so
anyway, then disabling warnings 'because it will make packages fail' is
counter-productive.

It's not like -Werror is the default.

> I don't like seeing us modify upstream compiler behavior in Debian this
> way, but I can understand not wanting to introduce what could have easily
> been hundreds of failures.  (The problem, of course, is that those
> failures are still latent, and unless we're going to keep this going
> forward, we have cleanup to do so that we can go back to tracking
> GCC's normal behavior.)

I'm not saying I don't understand the rationale; I do. But I don't agree
with it; I don't think it's the right thing to do.

-- 
The volume of a pizza of thickness a and radius z can be described by
the following formula:

pi zz a

Attachment: signature.asc
Description: Digital signature


Reply to: