]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/cpp/implementation-limits.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / cpp / implementation-limits.rst
CommitLineData
c63539ff
ML
1..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6.. index:: implementation limits
7
8.. _implementation-limits:
9
10Implementation limits
11*********************
12
13CPP has a small number of internal limits. This section lists the
14limits which the C standard requires to be no lower than some minimum,
15and all the others known. It is intended that there should be as few limits
16as possible. If you encounter an undocumented or inconvenient limit,
17please report that as a bug. See :ref:`gcc:bugs`.
18
19Where we say something is limited :dfn:`only by available memory`, that
20means that internal data structures impose no intrinsic limit, and space
21is allocated with ``malloc`` or equivalent. The actual limit will
22therefore depend on many things, such as the size of other things
23allocated by the compiler at the same time, the amount of memory
24consumed by other processes on the same computer, etc.
25
26* Nesting levels of :samp:`#include` files.
27
28 We impose an arbitrary limit of 200 levels, to avoid runaway recursion.
29 The standard requires at least 15 levels.
30
31* Nesting levels of conditional inclusion.
32
33 The C standard mandates this be at least 63. CPP is limited only by
34 available memory.
35
36* Levels of parenthesized expressions within a full expression.
37
38 The C standard requires this to be at least 63. In preprocessor
39 conditional expressions, it is limited only by available memory.
40
41* Significant initial characters in an identifier or macro name.
42
43 The preprocessor treats all characters as significant. The C standard
44 requires only that the first 63 be significant.
45
46* Number of macros simultaneously defined in a single translation unit.
47
48 The standard requires at least 4095 be possible. CPP is limited only
49 by available memory.
50
51* Number of parameters in a macro definition and arguments in a macro call.
52
53 We allow ``USHRT_MAX``, which is no smaller than 65,535. The minimum
54 required by the standard is 127.
55
56* Number of characters on a logical source line.
57
58 The C standard requires a minimum of 4096 be permitted. CPP places
59 no limits on this, but you may get incorrect column numbers reported in
60 diagnostics for lines longer than 65,535 characters.
61
62* Maximum size of a source file.
63
64 The standard does not specify any lower limit on the maximum size of a
65 source file. GNU cpp maps files into memory, so it is limited by the
66 available address space. This is generally at least two gigabytes.
67 Depending on the operating system, the size of physical memory may or
3ed1b4ce 68 may not be a limitation.