<div dir="ltr"><div>Hi, <br><br></div>The sole purpose of Werror is to keep warnings out. But libinput already did a good job without Wall + Werror being enabled.<br><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 21, 2015 at 4:05 AM, Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Aug 20, 2015 at 02:32:23PM +0300, Pekka Paalanen wrote:<br>
> On Thu, 20 Aug 2015 12:51:38 +0200<br>
> Andreas Pokorny <<a href="mailto:andreas.pokorny@canonical.com">andreas.pokorny@canonical.com</a>> wrote:<br>
><br>
> > Just a small change in test is necessary to enable -Wall -Werror.<br>
> ><br>
> > Signed-off-by: Andreas Pokorny <<a href="mailto:andreas.pokorny@canonical.com">andreas.pokorny@canonical.com</a>><br>
> > ---<br>
> > <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> | 4 ++--<br>
> > test/litest.c | 8 ++++++--<br>
> > 2 files changed, 8 insertions(+), 4 deletions(-)<br>
> ><br>
> > diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> > index 885cb39..b7597f0 100644<br>
> > --- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> > +++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> > @@ -87,8 +87,8 @@ AC_CHECK_LIB([m], [atan2])<br>
> > AC_CHECK_LIB([rt], [clock_gettime])<br>
> ><br>
> > if test "x$GCC" = "xyes"; then<br>
> > - GCC_CXXFLAGS="-Wall -Wextra -Wno-unused-parameter -g -fvisibility=hidden"<br>
> > - GCC_CFLAGS="$GCC_CXXFLAGS -Wmissing-prototypes -Wstrict-prototypes"<br>
> > + GCC_CXXFLAGS="-Wall -Werror -Wextra -Wno-unused-parameter -g -fvisibility=hidden"<br>
> > + GCC_CFLAGS="$GCC_CXXFLAGS -Wall -Werror -Wmissing-prototypes -Wstrict-prototypes"<br>
><br>
> Hi,<br>
><br>
> are you sure you want to force -Werror on everyone? Even distribution<br>
> builds?<br></div></div></blockquote><div><br></div><div>Rather force it on the project. I think that developers are usually ahead of distributions in terms of compiler versions. <br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
><br>
> New compilers come out with new warnings, new or old headers might<br>
> cause warnings...<br>
><br>
> While checking with colleagues, I was pointed at<br>
> <a href="https://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html" rel="noreferrer" target="_blank">https://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html</a><br>
> Maybe that could inspire something?<br>
><br>
<br>
</div></div>yeah, I agree with Pekka here. -Werror is almost always wrong unless you<br>
added it yourself to the $CFLAGS on the host you're building on.<br>
Worse, -Werror doesn't actually add anything - the reason these warnings<br>
haven't been caught before was because they didn't show up. some of them<br>
depend on compiler versions, library versions, etc.<br></blockquote><div><br></div><div>The second warning showed up because I added -Wall which before was only present in the CXXFLAGS.<br></div><div>You get something out of Werror if you enforce it, and sure Werror does not add additional warnings.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
AX_COMPILER_FLAGS looks interesting, but unsure on the result. the term<br>
"useful warnings" can be quite project-dependent and adding #pragmas to turn<br>
some of them off isn't helpful either. Haven't tried it yet though. <br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Merged patch 1/2 though, thanks.<br></blockquote><div><br></div><div>Thanks.<br><br></div><div>regards<br></div><div>Andreas<br></div></div></div></div></div></div></div></div>