Contents | < Browse | Browse >
Other incompatibilities
=======================
There are a few other incompatibilities between this implementation
of `m4', and the System V version.
* GNU `m4' implements sync lines differently from System V `m4',
when text is being diverted. GNU `m4' outputs the sync lines when
the text is being diverted, and System V `m4' when the diverted
text is being brought back.
The problem is which lines and filenames should be attached to
text that is being, or has been, diverted. System V `m4' regards
all the diverted text as being generated by the source line
containing the `undivert' call, whereas GNU `m4' regards the
diverted text as being generated at the time it is diverted.
Which is right? I expect the sync line option to be used mostly
when using `m4' as a front end to a compiler. If a diverted line
causes a compiler error, I believe that the error messages should
refer to the place where the diversion were made, and not where it
was inserted again. Comments anyone?
Anyway, GNU `m4''s approach causes a serious bug, if calls to
undivert aren't alone on the input line. See the file
`examples/divert.m4' for a demonstration of the bug. I don't feel
it is acceptable to insert newlines in the output the user hasn't
asked for.
* GNU `m4' without `-G' option will define the macro `__gnu__' to
expand to the empty string.
On Unix systems, GNU `m4' without the `-G' option will define the
macro `__unix__', otherwise the macro `unix'. Both will expand to
the empty string.