[commit] Build memmem with -Wno-error.

Pedro Alves pedro@codesourcery.com
Tue Aug 31 19:48:00 GMT 2010


On Tuesday 31 August 2010 20:08:26, Joel Brobecker wrote:

> +# We build memmem.c with -Wno-error because this file is not under
> +# our control.  On LynxOS, the compiler generates some warnings
> +# because str-two-way.h uses a constant (MAX_SIZE) whose definition
> +# makes it ambiguous whether it is signed or unsigned ("warning: this
> +# decimal constant is unsigned only in ISO C90").
>  memmem.o: ../gnulib/memmem.c
> -	$(CC) -o memmem.o -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
> +	$(CC) -o memmem.o -c $(CPPFLAGS) $(INTERNAL_CFLAGS) -Wno-error $<


Sorry, I didn't realize you were talking about "-Wno-error" literally.
This may break non-gcc compilers.  It would be better to come up with
an $(INTERNAL_CFLAGS) variant that does not include -Werror in the first
place, and use that instead in the memmem.o rule.  gdb/Makefile.in uses
INTERNAL_WARN_CFLAGS for exactly that.  I suggest to do the same here.  Take
a look at the monitor.o rule in gdb/Makefile.in.

-- 
Pedro Alves



More information about the Gdb-patches mailing list