1<html lang="en"> 2<head> 3<title>Implementation limits - The C Preprocessor</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="The C Preprocessor"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Implementation-Details.html#Implementation-Details" title="Implementation Details"> 9<link rel="prev" href="Implementation_002ddefined-behavior.html#Implementation_002ddefined-behavior" title="Implementation-defined behavior"> 10<link rel="next" href="Obsolete-Features.html#Obsolete-Features" title="Obsolete Features"> 11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 12<!-- 13Copyright (C) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 141997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 152008, 2009, 2010, 2011 16Free Software Foundation, Inc. 17 18Permission is granted to copy, distribute and/or modify this document 19under the terms of the GNU Free Documentation License, Version 1.3 or 20any later version published by the Free Software Foundation. A copy of 21the license is included in the 22section entitled ``GNU Free Documentation License''. 23 24This manual contains no Invariant Sections. The Front-Cover Texts are 25(a) (see below), and the Back-Cover Texts are (b) (see below). 26 27(a) The FSF's Front-Cover Text is: 28 29 A GNU Manual 30 31(b) The FSF's Back-Cover Text is: 32 33 You have freedom to copy and modify this GNU Manual, like GNU 34 software. Copies published by the Free Software Foundation raise 35 funds for GNU development. 36--> 37<meta http-equiv="Content-Style-Type" content="text/css"> 38<style type="text/css"><!-- 39 pre.display { font-family:inherit } 40 pre.format { font-family:inherit } 41 pre.smalldisplay { font-family:inherit; font-size:smaller } 42 pre.smallformat { font-family:inherit; font-size:smaller } 43 pre.smallexample { font-size:smaller } 44 pre.smalllisp { font-size:smaller } 45 span.sc { font-variant:small-caps } 46 span.roman { font-family:serif; font-weight:normal; } 47 span.sansserif { font-family:sans-serif; font-weight:normal; } 48--></style> 49<link rel="stylesheet" type="text/css" href="../cs.css"> 50</head> 51<body> 52<div class="node"> 53<a name="Implementation-limits"></a> 54<p> 55Next: <a rel="next" accesskey="n" href="Obsolete-Features.html#Obsolete-Features">Obsolete Features</a>, 56Previous: <a rel="previous" accesskey="p" href="Implementation_002ddefined-behavior.html#Implementation_002ddefined-behavior">Implementation-defined behavior</a>, 57Up: <a rel="up" accesskey="u" href="Implementation-Details.html#Implementation-Details">Implementation Details</a> 58<hr> 59</div> 60 61<h3 class="section">11.2 Implementation limits</h3> 62 63<p><a name="index-implementation-limits-110"></a> 64CPP has a small number of internal limits. This section lists the 65limits which the C standard requires to be no lower than some minimum, 66and all the others known. It is intended that there should be as few limits 67as possible. If you encounter an undocumented or inconvenient limit, 68please report that as a bug. See <a href="../gcc/Bugs.html#Bugs">Reporting Bugs</a>. 69 70 <p>Where we say something is limited <dfn>only by available memory</dfn>, that 71means that internal data structures impose no intrinsic limit, and space 72is allocated with <code>malloc</code> or equivalent. The actual limit will 73therefore depend on many things, such as the size of other things 74allocated by the compiler at the same time, the amount of memory 75consumed by other processes on the same computer, etc. 76 77 <ul> 78<li>Nesting levels of ‘<samp><span class="samp">#include</span></samp>’ files. 79 80 <p>We impose an arbitrary limit of 200 levels, to avoid runaway recursion. 81The standard requires at least 15 levels. 82 83 <li>Nesting levels of conditional inclusion. 84 85 <p>The C standard mandates this be at least 63. CPP is limited only by 86available memory. 87 88 <li>Levels of parenthesized expressions within a full expression. 89 90 <p>The C standard requires this to be at least 63. In preprocessor 91conditional expressions, it is limited only by available memory. 92 93 <li>Significant initial characters in an identifier or macro name. 94 95 <p>The preprocessor treats all characters as significant. The C standard 96requires only that the first 63 be significant. 97 98 <li>Number of macros simultaneously defined in a single translation unit. 99 100 <p>The standard requires at least 4095 be possible. CPP is limited only 101by available memory. 102 103 <li>Number of parameters in a macro definition and arguments in a macro call. 104 105 <p>We allow <code>USHRT_MAX</code>, which is no smaller than 65,535. The minimum 106required by the standard is 127. 107 108 <li>Number of characters on a logical source line. 109 110 <p>The C standard requires a minimum of 4096 be permitted. CPP places 111no limits on this, but you may get incorrect column numbers reported in 112diagnostics for lines longer than 65,535 characters. 113 114 <li>Maximum size of a source file. 115 116 <p>The standard does not specify any lower limit on the maximum size of a 117source file. GNU cpp maps files into memory, so it is limited by the 118available address space. This is generally at least two gigabytes. 119Depending on the operating system, the size of physical memory may or 120may not be a limitation. 121 122 </ul> 123 124 </body></html> 125 126