[rrd-developers] [PATCH] Use -Werror.

Sebastian Harl sh at tokkee.org
Wed Oct 1 23:20:02 CEST 2008


Hi Tobi,

On Wed, Oct 01, 2008 at 10:01:46PM +0200, Tobias Oetiker wrote:
> Thanks for putting in all the fixes. I have applied them. I did
> remove the -Werror though. I do like this for development, but as
> rrdtool is also compiled by the unsuspecting public, it would be
> rather unfortunate if it broke because some new / different version
> of gcc chooses to spit out warnings on issues in the rrd code which
> then cause it to fail on a platform.

Well, usually such warnings indicate real problems. Admittedly, some of
them might be minor issues but it does also include possible segfaults
as seen in my patch. So, if those are detected by users that's a good
thing imho. Also, enabling -Werror by default forces contributors to fix
any such issues before submitting their patches. Both of that should
improve the overall quality of the code.

OTOH, currently, a lot of extra warnings are enabled by default which
increase the risk of a build failure because of really minor issues. So,
I suggest to do the following:

  * disable (most of) those extra warnings by default and add a
    configure option like --enable-strict-warnings to re-enable them on
    demand

  * use -Wall -Werror by default - this should catch common and real
    errors only

  * possibly add another configure option to disable the use of -Werror
    as a way out for the user and document that

What do you think? Does that sound like a feasible compromise to you? If
you like that I'll provide a patch for it.

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20081001/ad1d700e/attachment.bin 


More information about the rrd-developers mailing list