GNU Info

Info Node: (m4.info)Errprint

(m4.info)Errprint


Next: M4exit Prev: Miscellaneous Up: Miscellaneous
Enter node , (file) or (file)node

Printing error messages
=======================

   You can print error messages using `errprint':

     errprint(MESSAGE, ...)

which simply prints MESSAGE and the rest of the arguments on the
standard error output.

   The expansion of `errprint' is void.

     errprint(`Illegal arguments to forloop
     ')
     error-->Illegal arguments to forloop
     =>

   A trailing newline is _not_ printed automatically, so it must be
supplied as part of the argument, as in the example.  (BSD flavored
`m4''s do append a trailing newline on each `errprint' call).

   To make it possible to specify the location of the error, two
utility builtins exist:

     __file__
     __line__

which expands to the quoted name of the current input file, and the
current input line number in that file.

     errprint(`m4:'__file__:__line__: `Input error
     ')
     error-->m4:56.errprint:2: Input error
     =>


automatically generated by info2www version 1.2.2.9