Re: compiler warnings, -Werror, etc.



On 07/28/2012 08:58 AM, Benjamin Otte wrote:
> Second, I don't think you are the right person to determine which warnings are
> or are not important. Apparently the GCC developers think otherwise and I
> frankly trust them more than I trust you.

By that logic, you should never pass any extra -W options beyond -Wall
either, since those warnings apparently aren't important.

> I work in a module where people do not want to use -Werror. This leads to
> regular commits with warnings

If a module uses AM_SILENT_RULES and compiles without warnings, then
anyone who commits code to it that adds warnings should be publicly
flogged. (Likewise people who break "make check".) The argument against
-Werror is not "people should be allowed to commit broken code". It's
"people should not be forced to interrupt what they're doing and fix
warnings in code that's completely unrelated to what they're working on
just because their distro upgraded gcc before yours did".

Don't we have build bots somewhere? They could check this stuff... lots
of other projects do that. (Having a build-warning-detecting bot would
also help for the case where the warning only shows up with -O2, but the
developer compiles with -O0 for ease of debugging...)

> I think what we should do is restrict the list of supported compilers - in
> particular for git checkouts, but I'd argue we should require gcc >= 4.4 for
> GNOME compilation.

The problem isn't "old gcc releases", it's "either older or newer gcc
releases". If you want everyone to get the same warnings, you need to
require that everyone use a specific version of gcc, and compile with
the same optimization level.

-- Dan


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