There are some limits within m4 that can be tuned. For
compatibility, m4 also accepts some options that control limits
in other implementations, but which are automatically unbounded (limited
only by your hardware and operating system constraints) in GNU
m4.
-g--gnu-G--traditional-H num--hashsize=num-L num--nesting-limit=numThe precise effect of this option is more correctly associated
with textual nesting than dynamic recursion. It has been useful
when some complex m4 input was generated by mechanical means, and
also in diagnosing recursive algorithms that do not scale well.
Most users never need to change this option from its default.
This option does not have the ability to break endless
rescanning loops, since these do not necessarily consume much memory
or stack space. Through clever usage of rescanning loops, one can
request complex, time-consuming computations from m4 with useful
results. Putting limitations in this area would break m4 power.
There are many pathological cases: ‘define(`a', `a')a’ is
only the simplest example (but see Compatibility). Expecting GNU
m4 to detect these would be a little like expecting a compiler
system to detect and diagnose endless loops: it is a quite hard
problem in general, if not undecidable!
-B num-S num-T numm4, but
do nothing in this implementation. They may disappear in future
releases, and issue a warning to that effect.
-N num--diversions=numm4, and were controlling the number of
possible diversions which could be used at the same time. They do nothing,
because there is no fixed limit anymore. They may disappear in future
releases, and issue a warning to that effect.