autoconf
[Top][All Lists]
Advanced

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

Re: Testing for unknown flags in different compilers


From: David A. Wheeler
Subject: Re: Testing for unknown flags in different compilers
Date: Fri, 21 Feb 2014 17:30:09 -0500 (EST)

Dale Visser:
>>> I have been working on a changes whereby an autoconf
>>> user can invoke a macro like
>>> AC_WARN_ADD([-Wextra])

Carsten Heinrici:
> The point is the portability. Your flags (-Wextra) depend on the actual 
> compiler. This js against the philosophy behind autoconf, which tries to 
> abstract from it.

I disagree, I think this is EXACTLY in the spirit of autoconf.
AC_WARN_ADD is a probe, just like many other autoconf macros.
In this case, this probe determines if "-Wextra" would be okay to add to
the (current) compiler flag, and adds it ONLY if it's okay to add to add it.

I think the macro needs a better name, e.g., "AC_ADD_FLAG_IFVALID" or something.
As far as I can tell this flag-probing macro isn't limited to warnings at all,
so its name may as well reflect that.  That said, enabling or disabling
warnings is what *I* would use this macro for.

> What would be required is a general macro AC_EXTRA_WARNINGS without arguments 
> which could resolve to the actually current arguments of the tool.

Dale Visser is also proposing something like this, though by default.
I think it is *vitally* important that warning flags be on by *default*,
as I've posted earlier. If it's only an option, then in many cases developers 
and users
will fail to see the warnings that often hint at serious problems
(as sadly happens now).

--- David A. Wheeler



reply via email to

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