[Main]
Title=Implementation Limits

[Top]
CPP has a small number of internal limits.  This section lists the
limits which the C standard requires to be no lower than some minimum,
and all the others we are aware of.  We intend there to be as few limits
as possible.  If you encounter an undocumented or inconvenient limit,
please report that to us as a bug.  (See the section on reporting bugs in
the GCC manual.)
<BR><BR>
Where we say something is limited <U>only by available memory</U>, that
means that internal data structures impose no intrinsic limit, and space
is allocated with <CODE>malloc</CODE> or equivalent.  The actual limit will
therefore depend on many things, such as the size of other things
allocated by the compiler at the same time, the amount of memory
consumed by other processes on the same computer, etc.
<UL>
<LI>
Nesting levels of <CODE>#include</CODE> files.
We impose an arbitrary limit of 200 levels, to avoid runaway recursion.
The standard requires at least 15 levels.
<BR><BR>
</LI>
<LI>
Nesting levels of conditional inclusion.
The C standard mandates this be at least 63.  CPP is limited only by
available memory.
<BR><BR>
</LI>
<LI>
Levels of parenthesized expressions within a full expression.
The C standard requires this to be at least 63.  In preprocessor
conditional expressions, it is limited only by available memory.
<BR><BR>
</LI>
<LI>
Significant initial characters in an identifier or macro name.
The preprocessor treats all characters as significant.  The C standard
requires only that the first 63 be significant.
<BR><BR>
</LI>
<LI>
Number of macros simultaneously defined in a single translation unit.
The standard requires at least 4095 be possible.  CPP is limited only
by available memory.
<BR><BR>
</LI>
<LI>
Number of parameters in a macro definition and arguments in a macro call.
We allow <CODE>USHRT_MAX</CODE>, which is no smaller than 65,535.  The minimum
required by the standard is 127.
<BR><BR>
</LI>
<LI>
Number of characters on a logical source line.
The C standard requires a minimum of 4096 be permitted.  CPP places
no limits on this, but you may get incorrect column numbers reported in
diagnostics for lines longer than 65,535 characters.
<BR><BR>
</LI>
<LI>
Maximum size of a source file.
The standard does not specify any lower limit on the maximum size of a
source file.  GNU cpp maps files into memory, so it is limited by the
available address space.  This is generally at least two gigabytes.
Depending on the operating system, the size of physical memory may or
may not be a limitation.
</LI>
</UL>
