Post by Ralf WildenhuesHello Andrey,
Aplogies for the delay.
Post by Andrey SimonenkoHow to cancel flags set by AC_LANG_WERROR in autoconf-2.61?
In other words, is there a way to set -Werror flag only for
some of tests in configure.ac? (of course it is possible to
modify ac_c_werror_flag in configure.ac)
At the moment, the only way to do this is to modify $ac_c_werror_flag,
which however is undocumented in the Autoconf manual.
We have two choices: document ac_LANG_werror_flag, or add accessor
macros. (Or document the current limitation and be done with it.)
WDYT?
I think that a new macro should be added.
Something like this (may be AC_LANG_NO_WERROR should check that
AC_LANG_WERROR was used before?):
lang.m4:
# AC_LANG_NO_WERROR
# ------------------
# Do not treat warnings from the current language's preprocessor, compiler,
# and linker as fatal errors.
AC_DEFUN([AC_LANG_NO_WERROR],
[ac_[]_AC_LANG_ABBREV[]_werror_flag=])# AC_LANG_NO_WERROR
autoconf.texi:
@defmac AC_LANG_NO_WERROR
@acindex{LANG_NO_WERROR}
This macro cancels effects of @code{AC_LANG_WERROR} macro and Autoconf
will treat all warnings generated by the compiler, linker, and preprocessor
as it does before @code{AC_LANG_WERROR} macro. This macro must be used
only if @code{AC_LANG_WERROR} macro was used before.
@end defmac