Next: , Previous: , Up: The Macros  



AX_CFLAGS_WARN_ALL   [(shellvar[, default[, action-if-found[, action-if-not-found]]])]
AX_CXXFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])]
AX_FCFLAGS_WARN_ALL  [(shellvar[, default[, action-if-found[, action-if-not-found]]])]


Specify compiler options that enable most reasonable warnings. For the GNU Compiler Collection (GCC), for example, it will be "-Wall". The result is added to shellvar, one of CFLAGS, CXXFLAGS or FCFLAGS if the first parameter is not specified.

Each of these macros accepts the following optional arguments:

  - $1 - shellvar
      shell variable to use (CFLAGS, CXXFLAGS or FCFLAGS if not
      specified, depending on macro)
  - $2 - default
      value to use for flags if compiler vendor cannot be determined (by
      default, "")
  - $3 - action-if-found
      action to take if the compiler vendor has been successfully
      determined (by default, add the appropriate compiler flags to
  - $4 - action-if-not-found
      action to take if the compiler vendor has not been determined or
      is unknown (by default, add the default flags, or "" if not
      specified, to shellvar)

These macros use AX_COMPILER_VENDOR to determine which flags should be returned for a given compiler. Not all compilers currently have flags defined for them; patches are welcome. If need be, compiler flags may be made language-dependent: use a construct like the following:

  [vendor_name], [m4_if(_AC_LANG_PREFIX,[C],   VAR="--relevant-c-flags",dnl
                  m4_if(_AC_LANG_PREFIX,[CXX], VAR="--relevant-c++-flags",dnl
                  m4_if(_AC_LANG_PREFIX,[FC],  VAR="--relevant-fortran-flags",dnl
                  VAR="$2"; FOUND="no")))],

Note: These macros also depend on AX_PREPEND_FLAG.

Source Code

Download the latest version of ax_cflags_warn_all.m4 or browse the macro’s revision history.


Copyright © 2008 Guido U. Draheim
Copyright © 2010 Rhys Ulerich
Copyright © 2018 John Zaitseff

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <>.

As a special exception, the respective Autoconf Macro’s copyright owner gives unlimited permission to copy, distribute and modify the configure scripts that are the output of Autoconf when processing the Macro. You need not follow the terms of the GNU General Public License when using or distributing such scripts, even though portions of the text of the Macro appear in them. The GNU General Public License (GPL) does govern all other use of the material that constitutes the Autoconf Macro.

This special exception to the GPL applies to versions of the Autoconf Macro released by the Autoconf Archive. When you make and distribute a modified version of the Autoconf Macro, you may extend this special exception to the GPL to apply to your modified version as well.

Next: ax_check_aligned_access_required, Previous: ax_cflags_sun_option, Up: The Macros