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 =>
Go to the first, previous, next, last section, table of contents.