I'd be +1 on setting -Wno-error=strict-prototypes unconditionally
> On Oct 15, 2017, at 11:52 AM, Rainer Jung <rainer.j...@kippdata.de> wrote:
>
> Am 15.10.2017 um 16:25 schrieb Yann Ylavic:
>> On Sun, Oct 15, 2017 at 4:03 PM, Rainer Jung <rainer.j...@kippdata.de> wrote:
>>>
>>> Why is this happening now? The "-Werror" was backported last December in
>>> r1772330, which was a backport of r1702948 from trunk (May 2015). Maybe
>>> people haven't used maintainer mode since then?
>> During the backport process of r1772330, Jacob noticed that -Werror
>> was not working as expected (see STATUS changes in this commit). He
>> also made a comment on dev@ here:
>> https://marc.info/?l=apache-cvs&m=147508169616462&w=2
>> Maybe -Werror is just ignored somehow, because I always compile in
>> maintainer mode with several gcc versions...
>
> Thanks Yann, I actually only ran gcc with the respective flags. But indeed
> configure checks for each flag whether it is "working" and the program which
> gets compiled is:
>
> int
> main ()
> {
> struct tm tm; tm.tm_gmtoff;
> ;
> return 0;
> }
>
> So since we set -Wstrict-prototypes before, -Werror turns this into
>
> conftest.c:45:1: error: function declaration isn't a prototype
> [-Werror=strict-prototypes]
> main ()
> ^~~~
>
> and -Werror does not get set at all.
>
> Nevertheless I would still say that adding "-Wno-error=strict-prototypes" for
> any clang and gcc version that supports it would be the correct option. Then
> -Werror should automatically get applied again.
>
> So something like the following (simple) patch should be an improvement for
> gcc and clang and also fix Jim's problem. Of course since we then would have
> -Werror enabled probably for the first time for gcc other new problems might
> show (that will currently only be observable as warnings during maintainer
> builds).
>
> Index: configure.in
> ===================================================================
> --- configure.in (revision 1812218)
> +++ configure.in (working copy)
> @@ -597,6 +597,7 @@
> if test "$GCC" = "yes"; then
> APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes
> -Wmissing-declarations -Wpointer-arith])
> APACHE_ADD_GCC_CFLAG([-std=c89])
> + APACHE_ADD_GCC_CFLAG([-Wno-error=strict-prototypes])
> APACHE_ADD_GCC_CFLAG([-Werror])
> APACHE_ADD_GCC_CFLAG([-Wdeclaration-after-statement])
> APACHE_ADD_GCC_CFLAG([-Wformat])
>
> Regards,
>
> Rainer