[rrd-developers] [PATCH] Use -Werror.
Sebastian Harl
sh at tokkee.org
Wed Oct 1 17:50:29 CEST 2008
Hi Bernhard,
Thanks for your comments!
On Wed, Oct 01, 2008 at 05:40:33PM +0200, Bernhard Reutner-Fischer wrote:
> On Wed, Oct 01, 2008 at 04:57:39PM +0200, Sebastian Harl wrote:
> >diff --git a/program/bindings/tcl/tclrrd.c b/program/bindings/tcl/tclrrd.c
> >index d4593bb..7f604d9 100644
> >--- a/program/bindings/tcl/tclrrd.c
> >+++ b/program/bindings/tcl/tclrrd.c
> >@@ -97,7 +97,7 @@ static void getopt_squieeze(
> >
> > /* Thread-safe version */
> > static int Rrd_Create(
> >- ClientData clientData,
> >+ ClientData __attribute__((unused)) clientData,
>
> careful, not everybody accepts __attribute__
Yes, I know - __attribute__ was already used in other places in RRDtool
before though, so this is no regression.
> Usually some header has stanzas like
[...]
Feel free to send in another patch ;-)
> >diff --git a/program/configure.ac b/program/configure.ac
> >index 1e3da86..2370f21 100644
> >--- a/program/configure.ac
> >+++ b/program/configure.ac
> >@@ -138,6 +138,21 @@ AC_PROG_LIBTOOL
> > dnl Try to detect/use GNU features
> > CFLAGS="$CFLAGS -D_GNU_SOURCE"
> >
> >+dnl check for -Werror separatly
> >+dnl (quite a few autotool checks don't work with -Werror; also, the
> >+dnl check for -Werror fails after checking and adding the other flags)
> >+AC_CACHE_CHECK([if gcc likes the -Werror flag], rd_cv_gcc_flag__Werror,
>
> s/gcc/CC/
> and it's not a matter of "likes" but rather "supports", perhaps
Agreed - I just copied the already existing check for other compiler
flags and did not want to bloat the patch with unrelated cleanup stuff.
> >diff --git a/program/src/rrd_client.c b/program/src/rrd_client.c
> >index 44d4d60..76fded0 100644
> >--- a/program/src/rrd_client.c
> >+++ b/program/src/rrd_client.c
> >@@ -741,7 +741,7 @@ void rrdc_stats_free (rrdc_stats_t *ret_stats) /* {{{ */
> >
> > if (this->name != NULL)
> > {
> >- free (this->name);
> >+ free ((char *)this->name);
> > this->name = NULL;
> > }
>
> It's perfectly valid to free(NULL), so the check is redundant.
Again, this is unrelated to my patch.
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/76410af5/attachment.bin
More information about the rrd-developers
mailing list