manpagez: man pages & more
info autoconf
Home | html | info | man

File: autoconf.info,  Node: Diagnostic Macros,  Next: Diversion support,  Prev: Redefined M4 Macros,  Up: Programming in M4sugar

8.3.2 Diagnostic messages from M4sugar
--------------------------------------

When macros statically diagnose abnormal situations, benign or fatal,
they should report them using these macros.  For issuing dynamic issues,
i.e., when ‘configure’ is run, see *note Printing Messages::.

 -- Macro: m4_assert (EXPRESSION, [EXIT-STATUS = 1])
     Assert that the arithmetic EXPRESSION evaluates to non-zero.
     Otherwise, issue a fatal error, and exit ‘autom4te’ with
     EXIT-STATUS.

 -- Macro: m4_errprintn (MESSAGE)
     Similar to the builtin ‘m4_errprint’, except that a newline is
     guaranteed after MESSAGE.

 -- Macro: m4_fatal (MESSAGE)
     Report a severe error MESSAGE prefixed with the current location,
     and have ‘autom4te’ die.

 -- Macro: m4_location
     Useful as a prefix in a message line.  Short for:
          __file__:__line__

 -- Macro: m4_warn (CATEGORY, MESSAGE)
     Report MESSAGE as a warning (or as an error if requested by the
     user) if warnings of the CATEGORY are turned on.  If the message is
     emitted, it is prefixed with the current location, and followed by
     a call trace of all macros defined via ‘AC_DEFUN’ used to get to
     the current expansion.

     The CATEGORY must be one of:

     ‘cross’
          Warnings about constructs that may interfere with
          cross-compilation, such as using ‘AC_RUN_IFELSE’ without a
          default.

     ‘gnu’
          Warnings related to the GNU Coding Standards (*note
          (standards)Top::).  On by default.

     ‘obsolete’
          Warnings about obsolete features.  On by default.

     ‘override’
          Warnings about redefinitions of Autoconf internals.

     ‘portability’
          Warnings about non-portable constructs.

     ‘portability-recursive’
          Warnings about recursive Make variable expansions
          (‘$(foo$(x))’).

     ‘extra-portability’
          Extra warnings about non-portable constructs, covering
          rarely-used tools.

     ‘syntax’
          Warnings about questionable syntactic constructs, incorrectly
          ordered macro calls, typos, etc.  On by default.

     ‘unsupported’
          Warnings about unsupported features.  On by default.

     *Hacking Note:* The set of categories is defined by code in
     ‘autom4te’, not by M4sugar itself.  Additions should be coordinated
     with Automake, so that both sets of tools accept the same options.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.