Re: Turn on compiler warnings by default for AC_PROG_CC, AC_PROG_CXX & AC_PROG_FC

"David A. Wheeler" <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Message-ID <[email protected]>
On Tue, 14 Jan 2014 10:53:05 -0500, Dale Visser <[email protected]> wrote:
> One advantage of AC_FLAGS_WARN_ALL is that it has been written to work not
> only with gcc, but also with other compilers, such as clang and icc.

I think that's an awesome part of this approach.

> Also, it is possible to easily add flags in configure.ac using the provided
> AC_APPEND_FLAGS macro. For example, to specifically disable some warnings
> applicable to comment text:
> 
> AC_APPEND_FLAG([-Wno-comment], [CFLAGS])

I earlier replied to Dale Visser about this, but didn't reply to the whole list (sorry about that).

The AC_APPEND_FLAG doesn't provide the functionality I would want for portability,
because it doesn't really check if the flag works (and it doesn't report the checking either).
For example, if I add this:
AC_APPEND_FLAG([-Wno-such-option], [CFLAGS])
the "-Wno-such-option" is still passed to the compiler. Ugh.

Perhaps you could change its functionality, or create a separate macro with that functionality.
That way, you could enable/disable warnings on compilers that accepted the flag... and
still work on compilers that didn't support it.

Anyway, I think you're on the right path, just need some tweaks before it's ready.

--- David A. Wheeler
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.