| <html lang="en"> |
| <head> |
| <title>Implementation limits - The C Preprocessor</title> |
| <meta http-equiv="Content-Type" content="text/html"> |
| <meta name="description" content="The C Preprocessor"> |
| <meta name="generator" content="makeinfo 4.13"> |
| <link title="Top" rel="start" href="index.html#Top"> |
| <link rel="up" href="Implementation-Details.html#Implementation-Details" title="Implementation Details"> |
| <link rel="prev" href="Implementation_002ddefined-behavior.html#Implementation_002ddefined-behavior" title="Implementation-defined behavior"> |
| <link rel="next" href="Obsolete-Features.html#Obsolete-Features" title="Obsolete Features"> |
| <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> |
| <!-- |
| Copyright (C) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, |
| 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
| 2008, 2009, 2010 |
| Free Software Foundation, Inc. |
| |
| Permission is granted to copy, distribute and/or modify this document |
| under the terms of the GNU Free Documentation License, Version 1.2 or |
| any later version published by the Free Software Foundation. A copy of |
| the license is included in the |
| section entitled ``GNU Free Documentation License''. |
| |
| This manual contains no Invariant Sections. The Front-Cover Texts are |
| (a) (see below), and the Back-Cover Texts are (b) (see below). |
| |
| (a) The FSF's Front-Cover Text is: |
| |
| A GNU Manual |
| |
| (b) The FSF's Back-Cover Text is: |
| |
| You have freedom to copy and modify this GNU Manual, like GNU |
| software. Copies published by the Free Software Foundation raise |
| funds for GNU development. |
| --> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <style type="text/css"><!-- |
| pre.display { font-family:inherit } |
| pre.format { font-family:inherit } |
| pre.smalldisplay { font-family:inherit; font-size:smaller } |
| pre.smallformat { font-family:inherit; font-size:smaller } |
| pre.smallexample { font-size:smaller } |
| pre.smalllisp { font-size:smaller } |
| span.sc { font-variant:small-caps } |
| span.roman { font-family:serif; font-weight:normal; } |
| span.sansserif { font-family:sans-serif; font-weight:normal; } |
| --></style> |
| <link rel="stylesheet" type="text/css" href="../cs.css"> |
| </head> |
| <body> |
| <div class="node"> |
| <a name="Implementation-limits"></a> |
| <p> |
| Next: <a rel="next" accesskey="n" href="Obsolete-Features.html#Obsolete-Features">Obsolete Features</a>, |
| Previous: <a rel="previous" accesskey="p" href="Implementation_002ddefined-behavior.html#Implementation_002ddefined-behavior">Implementation-defined behavior</a>, |
| Up: <a rel="up" accesskey="u" href="Implementation-Details.html#Implementation-Details">Implementation Details</a> |
| <hr> |
| </div> |
| |
| <h3 class="section">11.2 Implementation limits</h3> |
| |
| <p><a name="index-implementation-limits-110"></a> |
| 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 known. It is intended that there should be as few limits |
| as possible. If you encounter an undocumented or inconvenient limit, |
| please report that as a bug. See <a href="../gcc/Bugs.html#Bugs">Reporting Bugs</a>. |
| |
| <p>Where we say something is limited <dfn>only by available memory</dfn>, 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 ‘<samp><span class="samp">#include</span></samp>’ files. |
| |
| <p>We impose an arbitrary limit of 200 levels, to avoid runaway recursion. |
| The standard requires at least 15 levels. |
| |
| <li>Nesting levels of conditional inclusion. |
| |
| <p>The C standard mandates this be at least 63. CPP is limited only by |
| available memory. |
| |
| <li>Levels of parenthesized expressions within a full expression. |
| |
| <p>The C standard requires this to be at least 63. In preprocessor |
| conditional expressions, it is limited only by available memory. |
| |
| <li>Significant initial characters in an identifier or macro name. |
| |
| <p>The preprocessor treats all characters as significant. The C standard |
| requires only that the first 63 be significant. |
| |
| <li>Number of macros simultaneously defined in a single translation unit. |
| |
| <p>The standard requires at least 4095 be possible. CPP is limited only |
| by available memory. |
| |
| <li>Number of parameters in a macro definition and arguments in a macro call. |
| |
| <p>We allow <code>USHRT_MAX</code>, which is no smaller than 65,535. The minimum |
| required by the standard is 127. |
| |
| <li>Number of characters on a logical source line. |
| |
| <p>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. |
| |
| <li>Maximum size of a source file. |
| |
| <p>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. |
| |
| </ul> |
| |
| </body></html> |
| |