]>
Commit | Line | Data |
---|---|---|
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 | ||
10 | Implementation limits | |
11 | ********************* | |
12 | ||
13 | CPP has a small number of internal limits. This section lists the | |
14 | limits which the C standard requires to be no lower than some minimum, | |
15 | and all the others known. It is intended that there should be as few limits | |
16 | as possible. If you encounter an undocumented or inconvenient limit, | |
17 | please report that as a bug. See :ref:`gcc:bugs`. | |
18 | ||
19 | Where we say something is limited :dfn:`only by available memory`, that | |
20 | means that internal data structures impose no intrinsic limit, and space | |
21 | is allocated with ``malloc`` or equivalent. The actual limit will | |
22 | therefore depend on many things, such as the size of other things | |
23 | allocated by the compiler at the same time, the amount of memory | |
24 | consumed 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. |