Next: , Previous: Preprocessor features, Up: Invoking m4


2.3 Command line options for limits control

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
--traditional
Suppress all the extensions made in this implementation, compared to the System V version. See Compatibility, for a list of these.
-H NUM
--hashsize=NUM
Make the internal hash table for symbol lookup be NUM entries big. For better performance, the number should be prime, but this is not checked. The default is 509 entries. It should not be necessary to increase this value, unless you define an excessive number of macros.
-L NUM
--nesting-limit=NUM
Artificially limit the nesting of macro calls to NUM levels, stopping program execution if this limit is ever exceeded. When not specified, nesting is limited to 1024 levels. A value of zero means unlimited; but then heavily nested code could potentially cause a stack overflow.

The precise effect of this option might be more correctly associated with textual nesting than dynamic recursion. It has been useful when some complex m4 input was generated by mechanical means. Most users would never need this option. If shown to be obtrusive, this option (which is still experimental) might well disappear.

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 NUM
These options are present for compatibility with System V m4, but do nothing in this implementation. They may disappear in future releases, and issue a warning to that effect.
-N NUM
--diversions=NUM
These options are present only for compatibility with previous versions of GNU m4, 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.