autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_PROG_LEX issue when compiling with -Werror


From: Tobias Brunner
Subject: Re: AC_PROG_LEX issue when compiling with -Werror
Date: Thu, 14 Jul 2022 17:13:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 14.07.22 15:50, Paul Eggert wrote:
On 7/14/22 03:03, Tobias Brunner wrote:
how to handle -Werror when we explicitly want to fail our automated
builds based on warnings without affecting the tests in configure.  Is
there a proper way to do this with Autoconf?

The way Gnulib-using programs do it, is to not use -Werror when running
./configure. Instead, use it when running 'make'. This makes sense, as
./configure does all sorts of low-level stuff that C compilers might
complain about incorrectly.

Commonly there's a 'make' macro WARN_CFLAGS that contains warning
options like -Wall, and WERROR_CFLAGS that contains just -Werror, and
then AM_CFLAGS (or CFLAGS or whatever) contains $(WARN_CFLAGS)
$(WERROR_CFLAGS). This lets the builder type 'make WERROR_CFLAGS=' to
ignore warning failures, if that's what's wanted.

See GNU Grep for an example of this.

Thanks, I'll have a look at that.

Regards,
Tobias



reply via email to

[Prev in Thread] Current Thread [Next in Thread]