As discussed on tech-toolchain@netbsd.org, make cpp refuse to attempt to

parse a #include'd file which does not pass S_ISREG() if the environment variable
CPP_RESTRICTED is set.

This is primarily intended for use by programs such as calendar(1) which
use cpp to parse untrusted user files -- without this change (and the corresponding
change to calendar(1)), any user can cause a denial-of-service for the daily
calendar -a run by #include'ing a named pipe.

Many thanks to christos@netbsd for his help in polishing this.
This commit is contained in:
jwise 2004-11-30 01:51:13 +00:00
parent 68f709428b
commit 48f45412af
4 changed files with 359 additions and 262 deletions

View File

@ -242,9 +242,13 @@ open_file (pfile, filename)
cpp_reader *pfile;
const char *filename;
{
const char *cpp_restricted;
splay_tree_node nd = find_or_create_entry (pfile, filename);
struct include_file *file = (struct include_file *) nd->value;
GET_ENVIRONMENT(cpp_restricted, "CPP_RESTRICTED");
if (file->err_no)
{
/* Ugh. handle_missing_header () needs errno to be set. */
@ -265,6 +269,9 @@ open_file (pfile, filename)
controlling terminal by mistake (this can't happen on sane
systems, but paranoia is a virtue).
We do, however, use nonblocking mode if CPP_RESTRICTED, since any
file which can block will be tossed out after fstat().
Use the three-argument form of open even though we aren't
specifying O_CREAT, to defend against broken system headers.
@ -285,12 +292,23 @@ open_file (pfile, filename)
#endif
}
else
file->fd = open (file->name, O_RDONLY | O_NOCTTY | O_BINARY, 0666);
{
int mode = O_RDONLY | O_NOCTTY | O_BINARY;
if (cpp_restricted != NULL)
mode |= O_NONBLOCK;
file->fd = open (file->name, mode, 0666);
}
if (file->fd != -1 && fstat (file->fd, &file->st) == 0)
{
if (!S_ISDIR (file->st.st_mode))
return file;
if ((cpp_restricted != NULL) ? S_ISREG (file->st.st_mode) : !S_ISDIR (file->st.st_mode))
{
if (cpp_restricted)
fcntl(file->fd, F_SETFL, fcntl(file->fd, F_GETFL, 0) & ~O_NONBLOCK);
return file;
}
/* If it's a directory, we return null and continue the search
as the file we're looking for may appear elsewhere in the

View File

@ -774,7 +774,8 @@ preprocess as normal. With two dashes, exit immediately.
.IX Header "ENVIRONMENT"
This section describes the environment variables that affect how \s-1CPP\s0
operates. You can use them to specify directories or prefixes to use
when searching for include files, or to control dependency output.
when searching for include files, or to control dependency output or behavior
in the face of include files which are device nodes or named pipes.
.PP
Note that you can also specify places to search using options such as
\&\fB\-I\fR, and control dependency output with options like
@ -834,6 +835,11 @@ This variable is the same as \fB\s-1DEPENDENCIES_OUTPUT\s0\fR (see above),
except that system header files are not ignored, so it implies
\&\fB\-M\fR rather than \fB\-MM\fR. However, the dependence on the
main input file is omitted.
.IP "\fB\s-1CPP_RESTRICTED\s0\fR" 4
.IX Item "CPP_RESTRICTED"
If this variable is defined, cpp will skip any include file which is not a
regular file, and will continue searching for the requested name (this is
always done if the found file is a directory).
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIcpp\fR, \fIgcc\fR, and

View File

@ -1,7 +1,7 @@
Ceci est le fichier Info doc/cpp.info, produit par Makeinfo version 4.6
à partir doc/cpp.texi.
This is doc/cpp.info, produced by makeinfo version 4.7 from
doc/cpp.texi.
Copyright (C) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
Copyright (C) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
@ -21,7 +21,8 @@ are (a) (see below), and the Back-Cover Texts are (b) (see below).
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.
funds for GNU development. man end
INFO-DIR-SECTION Programming
START-INFO-DIR-ENTRY
* Cpp: (cpp). The GNU C preprocessor.
@ -30,7 +31,8 @@ END-INFO-DIR-ENTRY

File: cpp.info, Node: Top, Next: Overview, Up: (dir)
The C Preprocessor
******************
The C preprocessor implements the macro language used to transform C,
C++, and Objective-C programs before they are compiled. It can also be
@ -130,7 +132,7 @@ Obsolete Features
* Assertions::
* Obsolete once-only headers::
Copyright (C) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
Copyright (C) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
@ -150,7 +152,8 @@ are (a) (see below), and the Back-Cover Texts are (b) (see below).
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.
funds for GNU development. man end

File: cpp.info, Node: Overview, Next: Header Files, Prev: Top, Up: Top
@ -315,7 +318,7 @@ standard.
// contains line comment
yet more comment
*/ outside comment
// line comment /* contains block comment */
But beware of commenting out one end of a block comment with a line
@ -668,7 +671,7 @@ this,
int x;
#include "header.h"
int
main (void)
{
@ -680,7 +683,7 @@ read
int x;
char *test (void);
int
main (void)
{
@ -790,9 +793,9 @@ contents of the file in a conditional, like this:
/* File foo. */
#ifndef FILE_FOO_SEEN
#define FILE_FOO_SEEN
THE ENTIRE FILE
#endif /* !FILE_FOO_SEEN */
This construct is commonly known as a "wrapper #ifndef". When the
@ -910,9 +913,8 @@ Headers::), it will recurse infinitely and cause a fatal error.
You could include the old header with an absolute pathname:
#include "/usr/include/old-header.h"
This works, but is not clean; should the system headers ever move, you
would have to edit the new headers to match.
This works, but is not clean; should the system headers ever move,
you would have to edit the new headers to match.
There is no way to solve this problem within the C standard, but you
can use the GNU extension `#include_next'. It means, "Include the
@ -971,6 +973,9 @@ command line. If the same directory is named by both `-I' and
`-isystem', the `-I' option is ignored. GCC provides an informative
message when this occurs if `-v' is used.
The `-isystem-cxx' command line option adds its argument to the list
of C++ system headers, similar to `-isystem' for C headers.
There is also a directive, `#pragma GCC system_header', which tells
GCC to consider the rest of the current include file a system header,
no matter where it was found. Code that comes before the `#pragma' in
@ -1238,7 +1243,7 @@ Here are some silly examples using `min':
min(a, ) ==> ((a ) < ( ) ? (a ) : ( ))
min(,) ==> (( ) < ( ) ? ( ) : ( ))
min((,),) ==> (((,)) < ( ) ? ((,)) : ( ))
min() error--> macro "min" requires 2 arguments, but only 1 given
min(,,) error--> macro "min" passed 3 arguments, but takes just 2
@ -1383,7 +1388,7 @@ as follows:
char *name;
void (*function) (void);
};
struct command commands[] =
{
{ "quit", quit_command },
@ -1399,7 +1404,7 @@ and the function name by concatenating the argument with `_command'.
Here is how it is done:
#define COMMAND(NAME) { #NAME, NAME ## _command }
struct command commands[] =
{
COMMAND (quit),
@ -1947,8 +1952,7 @@ These definitions are effectively the same:
#define FOUR (2 + 2)
#define FOUR (2 + 2)
#define FOUR (2 /* two */ + 2)
but these are not:
but these are not:
#define FOUR (2 + 2)
#define FOUR ( 2+2 )
#define FOUR (2 * 2)
@ -2276,7 +2280,7 @@ then `x' and `y' expand as follows:
x ==> (4 + y)
==> (4 + (2 * x))
y ==> (2 * x)
==> (2 * (4 + y))
@ -2385,7 +2389,7 @@ different to the line containing the argument causing the problem.
Here is an example illustrating this:
#define ignore_second_arg(a,b,c) a; c
ignore_second_arg (foo (),
ignored (),
syntax error);
@ -2494,9 +2498,9 @@ Ifdef
The simplest sort of conditional is
#ifdef MACRO
CONTROLLED TEXT
#endif /* MACRO */
This block is called a "conditional group". CONTROLLED TEXT will be
@ -2567,9 +2571,9 @@ The `#if' directive allows you to test the value of an arithmetic
expression, rather than the mere existence of one macro. Its syntax is
#if EXPRESSION
CONTROLLED TEXT
#endif /* EXPRESSION */
EXPRESSION is a C expression of integer type, subject to stringent
@ -3907,7 +3911,7 @@ single-letter options may _not_ be grouped: `-dM' is very different from
This is typical output:
test.o: test.c test.h
test.h:
`-MT TARGET'
@ -4076,6 +4080,13 @@ single-letter options may _not_ be grouped: `-dM' is very different from
applied to the standard system directories. *Note System
Headers::.
`-isystem-cxx DIR'
Search DIR for C++ header files, after all directories specified by
`-I' but before the standard system directories. Mark it as a
system directory, so that it gets the same special treatment as is
applied to the standard system directories. *Note System
Headers::.
`-fpreprocessed'
Indicate to the preprocessor that the input file has already been
preprocessed. This suppresses things like macro expansion,
@ -4269,6 +4280,13 @@ in turn take precedence over the configuration of GCC.
`-M' rather than `-MM'. However, the dependence on the main input
file is omitted. *Note Invocation::.
`CPP_RESTRICTED'
If this variable is defined, cpp will skip any include file which
is not a regular file, and will continue searching for the
requested name (this is always done if the found file is a
directory). *Note Invocation::.

File: cpp.info, Node: GNU Free Documentation License, Next: Index of Directives, Prev: Environment Variables, Up: Top
@ -4276,9 +4294,10 @@ GNU Free Documentation License
******************************
Version 1.2, November 2002
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@ -4706,30 +4725,33 @@ File: cpp.info, Node: Index of Directives, Next: Option Index, Prev: GNU Free
Index of Directives
*******************
[index]
* Menu:
* #assert: Assertions.
* #define: Object-like Macros.
* #elif: Elif.
* #else: Else.
* #endif: Ifdef.
* #error: Diagnostics.
* #ident: Other Directives.
* #if: Conditional Syntax.
* #ifdef: Ifdef.
* #ifndef: Ifdef.
* #assert: Assertions. (line 41)
* #define: Object-like Macros. (line 11)
* #elif: Elif. (line 6)
* #else: Else. (line 6)
* #endif: Ifdef. (line 6)
* #error: Diagnostics. (line 6)
* #ident: Other Directives. (line 6)
* #if: Conditional Syntax. (line 6)
* #ifdef: Ifdef. (line 6)
* #ifndef: Ifdef. (line 40)
* #import: Obsolete once-only headers.
* #include: Include Syntax.
* #include_next: Wrapper Headers.
* #line: Line Control.
* #pragma GCC dependency: Pragmas.
* #pragma GCC poison: Pragmas.
* #pragma GCC system_header <1>: Pragmas.
* #pragma GCC system_header: System Headers.
* #sccs: Other Directives.
* #unassert: Assertions.
(line 10)
* #include: Include Syntax. (line 6)
* #include_next: Wrapper Headers. (line 6)
* #line: Line Control. (line 20)
* #pragma GCC dependency: Pragmas. (line 53)
* #pragma GCC poison: Pragmas. (line 65)
* #pragma GCC system_header <1>: Pragmas. (line 92)
* #pragma GCC system_header: System Headers. (line 34)
* #sccs: Other Directives. (line 13)
* #unassert: Assertions. (line 52)
* #undef: Undefining and Redefining Macros.
* #warning: Diagnostics.
(line 6)
* #warning: Diagnostics. (line 27)

File: cpp.info, Node: Option Index, Next: Concept Index, Prev: Index of Directives, Up: Top
@ -4740,73 +4762,83 @@ Option Index
CPP's command line options and environment variables are indexed here
without any initial `-' or `--'.
[index]
* Menu:
* A: Invocation.
* ansi: Invocation.
* C: Invocation.
* A: Invocation. (line 433)
* ansi: Invocation. (line 297)
* C: Invocation. (line 481)
* C_INCLUDE_PATH: Environment Variables.
(line 16)
* CPATH: Environment Variables.
(line 15)
* CPLUS_INCLUDE_PATH: Environment Variables.
* D: Invocation.
* dD: Invocation.
(line 17)
* CPP_RESTRICTED: Environment Variables.
(line 66)
* D: Invocation. (line 39)
* dD: Invocation. (line 461)
* DEPENDENCIES_OUTPUT: Environment Variables.
* dI: Invocation.
* dM: Invocation.
* dN: Invocation.
* fno-show-column: Invocation.
* fpreprocessed: Invocation.
* ftabstop: Invocation.
* H: Invocation.
* help: Invocation.
* I: Invocation.
* I-: Invocation.
* idirafter: Invocation.
* imacros: Invocation.
* include: Invocation.
* iprefix: Invocation.
* isystem: Invocation.
* iwithprefix: Invocation.
* iwithprefixbefore: Invocation.
* M: Invocation.
* MD: Invocation.
* MF: Invocation.
* MG: Invocation.
* MM: Invocation.
* MMD: Invocation.
* MP: Invocation.
* MQ: Invocation.
* MT: Invocation.
* nostdinc: Invocation.
* nostdinc++: Invocation.
* o: Invocation.
(line 44)
* dI: Invocation. (line 470)
* dM: Invocation. (line 449)
* dN: Invocation. (line 467)
* fno-show-column: Invocation. (line 428)
* fpreprocessed: Invocation. (line 409)
* ftabstop: Invocation. (line 422)
* H: Invocation. (line 526)
* help: Invocation. (line 518)
* I: Invocation. (line 68)
* I-: Invocation. (line 334)
* idirafter: Invocation. (line 376)
* imacros: Invocation. (line 367)
* include: Invocation. (line 356)
* iprefix: Invocation. (line 381)
* isystem: Invocation. (line 395)
* isystemcxx: Invocation. (line 402)
* iwithprefix: Invocation. (line 387)
* iwithprefixbefore: Invocation. (line 387)
* M: Invocation. (line 171)
* MD: Invocation. (line 259)
* MF: Invocation. (line 205)
* MG: Invocation. (line 214)
* MM: Invocation. (line 195)
* MMD: Invocation. (line 274)
* MP: Invocation. (line 224)
* MQ: Invocation. (line 250)
* MT: Invocation. (line 236)
* nostdinc: Invocation. (line 346)
* nostdinc++: Invocation. (line 351)
* o: Invocation. (line 77)
* OBJC_INCLUDE_PATH: Environment Variables.
* P: Invocation.
* pedantic: Invocation.
* pedantic-errors: Invocation.
* remap: Invocation.
* std=: Invocation.
(line 18)
* P: Invocation. (line 474)
* pedantic: Invocation. (line 161)
* pedantic-errors: Invocation. (line 166)
* remap: Invocation. (line 513)
* std=: Invocation. (line 297)
* SUNPRO_DEPENDENCIES: Environment Variables.
* target-help: Invocation.
* traditional-cpp: Invocation.
* trigraphs: Invocation.
* U: Invocation.
* undef: Invocation.
* v: Invocation.
* version: Invocation.
* w: Invocation.
* Wall: Invocation.
* Wcomment: Invocation.
* Wcomments: Invocation.
* Wendif-labels: Invocation.
* Werror: Invocation.
* Wimport: Invocation.
* Wsystem-headers: Invocation.
* Wtraditional: Invocation.
* Wtrigraphs: Invocation.
* Wundef: Invocation.
* Wunused-macros: Invocation.
* x: Invocation.
(line 60)
* target-help: Invocation. (line 518)
* traditional-cpp: Invocation. (line 506)
* trigraphs: Invocation. (line 510)
* U: Invocation. (line 59)
* undef: Invocation. (line 63)
* v: Invocation. (line 522)
* version: Invocation. (line 532)
* w: Invocation. (line 157)
* Wall: Invocation. (line 83)
* Wcomment: Invocation. (line 90)
* Wcomments: Invocation. (line 90)
* Wendif-labels: Invocation. (line 134)
* Werror: Invocation. (line 147)
* Wimport: Invocation. (line 107)
* Wsystem-headers: Invocation. (line 151)
* Wtraditional: Invocation. (line 101)
* Wtrigraphs: Invocation. (line 95)
* Wundef: Invocation. (line 110)
* Wunused-macros: Invocation. (line 115)
* x: Invocation. (line 281)

File: cpp.info, Node: Concept Index, Prev: Option Index, Up: Top
@ -4814,187 +4846,215 @@ File: cpp.info, Node: Concept Index, Prev: Option Index, Up: Top
Concept Index
*************
[index]
* Menu:
* # operator: Stringification.
* ## operator: Concatenation.
* _Pragma: Pragmas.
* alternative tokens: Tokenization.
* arguments: Macro Arguments.
* arguments in macro definitions: Macro Arguments.
* assertions: Assertions.
* assertions, canceling: Assertions.
* backslash-newline: Initial processing.
* block comments: Initial processing.
* C++ named operators: C++ Named Operators.
* character constants: Tokenization.
* character sets: Initial processing.
* command line: Invocation.
* commenting out code: Deleted Code.
* comments: Initial processing.
* # operator: Stringification. (line 6)
* ## operator: Concatenation. (line 6)
* _Pragma: Pragmas. (line 25)
* alternative tokens: Tokenization. (line 105)
* arguments: Macro Arguments. (line 6)
* arguments in macro definitions: Macro Arguments. (line 6)
* assertions: Assertions. (line 6)
* assertions, canceling: Assertions. (line 52)
* backslash-newline: Initial processing. (line 69)
* block comments: Initial processing. (line 85)
* C++ named operators: C++ Named Operators. (line 6)
* character constants: Tokenization. (line 84)
* character sets: Initial processing. (line 14)
* command line: Invocation. (line 6)
* commenting out code: Deleted Code. (line 6)
* comments: Initial processing. (line 85)
* common predefined macros: Common Predefined Macros.
* computed includes: Computed Includes.
* concatenation: Concatenation.
* conditional group: Ifdef.
* conditionals: Conditionals.
* continued lines: Initial processing.
* controlling macro: Once-Only Headers.
* defined: Defined.
(line 6)
* computed includes: Computed Includes. (line 6)
* concatenation: Concatenation. (line 6)
* conditional group: Ifdef. (line 14)
* conditionals: Conditionals. (line 6)
* continued lines: Initial processing. (line 69)
* controlling macro: Once-Only Headers. (line 35)
* defined: Defined. (line 6)
* dependencies for make as output: Environment Variables.
* dependencies, make: Invocation.
* diagnostic: Diagnostics.
(line 45)
* dependencies, make: Invocation. (line 171)
* diagnostic: Diagnostics. (line 6)
* differences from previous versions: Differences from previous versions.
* digraphs: Tokenization.
(line 6)
* digraphs: Tokenization. (line 105)
* directive line: The preprocessing language.
(line 6)
* directive name: The preprocessing language.
(line 6)
* directives: The preprocessing language.
* empty macro arguments: Macro Arguments.
(line 6)
* only open regular files: Environment Variables.
(line 67)
* empty macro arguments: Macro Arguments. (line 66)
* environment variables: Environment Variables.
* expansion of arguments: Argument Prescan.
(line 6)
* expansion of arguments: Argument Prescan. (line 6)
* FDL, GNU Free Documentation License: GNU Free Documentation License.
(line 6)
* function-like macros: Function-like Macros.
* grouping options: Invocation.
* guard macro: Once-Only Headers.
* header file: Header Files.
* header file names: Tokenization.
* identifiers: Tokenization.
(line 6)
* grouping options: Invocation. (line 34)
* guard macro: Once-Only Headers. (line 35)
* header file: Header Files. (line 6)
* header file names: Tokenization. (line 84)
* identifiers: Tokenization. (line 34)
* implementation limits: Implementation limits.
(line 6)
* implementation-defined behavior: Implementation-defined behavior.
* including just once: Once-Only Headers.
* invocation: Invocation.
* iso646.h: C++ Named Operators.
* line comments: Initial processing.
* line control: Line Control.
* line endings: Initial processing.
* linemarkers: Preprocessor Output.
* macro argument expansion: Argument Prescan.
(line 6)
* including just once: Once-Only Headers. (line 6)
* invocation: Invocation. (line 6)
* iso646.h: C++ Named Operators. (line 6)
* line comments: Initial processing. (line 85)
* line control: Line Control. (line 6)
* line endings: Initial processing. (line 14)
* linemarkers: Preprocessor Output. (line 28)
* macro argument expansion: Argument Prescan. (line 6)
* macro arguments and directives: Directives Within Macro Arguments.
* macros in include: Computed Includes.
* macros with arguments: Macro Arguments.
* macros with variable arguments: Variadic Macros.
* make: Invocation.
* manifest constants: Object-like Macros.
* named operators: C++ Named Operators.
(line 6)
* macros in include: Computed Includes. (line 6)
* macros with arguments: Macro Arguments. (line 6)
* macros with variable arguments: Variadic Macros. (line 6)
* make: Invocation. (line 171)
* manifest constants: Object-like Macros. (line 6)
* named operators: C++ Named Operators. (line 6)
* newlines in macro arguments: Newlines in Arguments.
* null directive: Other Directives.
* numbers: Tokenization.
* object-like macro: Object-like Macros.
* options: Invocation.
* options, grouping: Invocation.
* other tokens: Tokenization.
* output format: Preprocessor Output.
* overriding a header file: Wrapper Headers.
(line 6)
* null directive: Other Directives. (line 18)
* numbers: Tokenization. (line 60)
* object-like macro: Object-like Macros. (line 6)
* options: Invocation. (line 38)
* options, grouping: Invocation. (line 34)
* other tokens: Tokenization. (line 119)
* output format: Preprocessor Output. (line 12)
* overriding a header file: Wrapper Headers. (line 6)
* parentheses in macro bodies: Operator Precedence Problems.
* pitfalls of macros: Macro Pitfalls.
* predefined macros: Predefined Macros.
(line 6)
* pitfalls of macros: Macro Pitfalls. (line 6)
* predefined macros: Predefined Macros. (line 6)
* predefined macros, system-specific: System-specific Predefined Macros.
* predicates: Assertions.
(line 6)
* predicates: Assertions. (line 19)
* preprocessing directives: The preprocessing language.
* preprocessing numbers: Tokenization.
* preprocessing tokens: Tokenization.
* prescan of macro arguments: Argument Prescan.
* problems with macros: Macro Pitfalls.
* punctuators: Tokenization.
(line 6)
* preprocessing numbers: Tokenization. (line 60)
* preprocessing tokens: Tokenization. (line 6)
* prescan of macro arguments: Argument Prescan. (line 6)
* problems with macros: Macro Pitfalls. (line 6)
* punctuators: Tokenization. (line 105)
* redefining macros: Undefining and Redefining Macros.
* repeated inclusion: Once-Only Headers.
* reporting errors: Diagnostics.
* reporting warnings: Diagnostics.
(line 6)
* repeated inclusion: Once-Only Headers. (line 6)
* reporting errors: Diagnostics. (line 6)
* reporting warnings: Diagnostics. (line 6)
* reserved namespace: System-specific Predefined Macros.
(line 6)
* self-reference: Self-Referential Macros.
(line 6)
* semicolons (after macro calls): Swallowing the Semicolon.
(line 6)
* side effects (in macro arguments): Duplication of Side Effects.
(line 6)
* standard predefined macros.: Standard Predefined Macros.
* string constants: Tokenization.
* string literals: Tokenization.
* stringification: Stringification.
* symbolic constants: Object-like Macros.
* system header files <1>: System Headers.
* system header files: Header Files.
(line 6)
* string constants: Tokenization. (line 84)
* string literals: Tokenization. (line 84)
* stringification: Stringification. (line 6)
* symbolic constants: Object-like Macros. (line 6)
* system header files <1>: Header Files. (line 13)
* system header files: System Headers. (line 6)
* system-specific predefined macros: System-specific Predefined Macros.
* testing predicates: Assertions.
* token concatenation: Concatenation.
* token pasting: Concatenation.
* tokens: Tokenization.
* trigraphs: Initial processing.
(line 6)
* testing predicates: Assertions. (line 30)
* token concatenation: Concatenation. (line 6)
* token pasting: Concatenation. (line 6)
* tokens: Tokenization. (line 6)
* trigraphs: Initial processing. (line 42)
* undefining macros: Undefining and Redefining Macros.
(line 6)
* unsafe macros: Duplication of Side Effects.
* variable number of arguments: Variadic Macros.
* variadic macros: Variadic Macros.
* wrapper #ifndef: Once-Only Headers.
* wrapper headers: Wrapper Headers.
(line 6)
* variable number of arguments: Variadic Macros. (line 6)
* variadic macros: Variadic Macros. (line 6)
* wrapper #ifndef: Once-Only Headers. (line 6)
* wrapper headers: Wrapper Headers. (line 6)

Tag Table:
Node: Top1043
Node: Overview3663
Node: Initial processing6461
Ref: trigraphs8576
Node: Tokenization12682
Ref: Tokenization-Footnote-119728
Node: The preprocessing language19839
Node: Header Files22709
Node: Include Syntax24585
Node: Include Operation26084
Node: Search Path27934
Node: Once-Only Headers31008
Node: Computed Includes32655
Node: Wrapper Headers35791
Node: System Headers38207
Node: Macros40249
Node: Object-like Macros41386
Node: Function-like Macros44969
Node: Macro Arguments46577
Node: Stringification50719
Node: Concatenation53917
Node: Variadic Macros57027
Node: Predefined Macros61806
Node: Standard Predefined Macros62386
Node: Common Predefined Macros68290
Node: System-specific Predefined Macros76122
Node: C++ Named Operators78131
Node: Undefining and Redefining Macros79083
Node: Directives Within Macro Arguments81177
Node: Macro Pitfalls82717
Node: Misnesting83240
Node: Operator Precedence Problems84338
Node: Swallowing the Semicolon86190
Node: Duplication of Side Effects88199
Node: Self-Referential Macros90368
Node: Argument Prescan92774
Node: Newlines in Arguments96514
Node: Conditionals97456
Node: Conditional Uses99282
Node: Conditional Syntax100632
Node: Ifdef100944
Node: If104103
Node: Defined106513
Node: Else107784
Node: Elif108342
Node: Deleted Code109619
Node: Diagnostics110858
Node: Line Control112471
Node: Pragmas116271
Node: Other Directives120537
Node: Preprocessor Output121726
Node: Traditional Mode124923
Node: Traditional lexical analysis125975
Node: Traditional macros128468
Node: Traditional miscellany132259
Node: Traditional warnings133246
Node: Implementation Details135433
Node: Implementation-defined behavior136048
Node: Implementation limits138719
Node: Obsolete Features141407
Node: Assertions141852
Node: Obsolete once-only headers144379
Node: Differences from previous versions146100
Node: Invocation150169
Ref: -MF158763
Node: Environment Variables171424
Node: GNU Free Documentation License174374
Node: Index of Directives196801
Node: Option Index198181
Node: Concept Index201932
Node: Top1033
Node: Overview3701
Node: Initial processing6499
Ref: trigraphs8614
Node: Tokenization12715
Ref: Tokenization-Footnote-119761
Node: The preprocessing language19872
Node: Header Files22742
Node: Include Syntax24618
Node: Include Operation26117
Node: Search Path27957
Node: Once-Only Headers31031
Node: Computed Includes32668
Node: Wrapper Headers35804
Node: System Headers38222
Node: Macros40397
Node: Object-like Macros41534
Node: Function-like Macros45117
Node: Macro Arguments46725
Node: Stringification50862
Node: Concatenation54060
Node: Variadic Macros57160
Node: Predefined Macros61939
Node: Standard Predefined Macros62519
Node: Common Predefined Macros68423
Node: System-specific Predefined Macros76255
Node: C++ Named Operators78264
Node: Undefining and Redefining Macros79216
Node: Directives Within Macro Arguments81312
Node: Macro Pitfalls82852
Node: Misnesting83375
Node: Operator Precedence Problems84473
Node: Swallowing the Semicolon86325
Node: Duplication of Side Effects88334
Node: Self-Referential Macros90503
Node: Argument Prescan92904
Node: Newlines in Arguments96644
Node: Conditionals97581
Node: Conditional Uses99407
Node: Conditional Syntax100757
Node: Ifdef101069
Node: If104218
Node: Defined106618
Node: Else107889
Node: Elif108447
Node: Deleted Code109724
Node: Diagnostics110963
Node: Line Control112576
Node: Pragmas116376
Node: Other Directives120642
Node: Preprocessor Output121831
Node: Traditional Mode125028
Node: Traditional lexical analysis126080
Node: Traditional macros128573
Node: Traditional miscellany132364
Node: Traditional warnings133351
Node: Implementation Details135538
Node: Implementation-defined behavior136153
Node: Implementation limits138824
Node: Obsolete Features141512
Node: Assertions141957
Node: Obsolete once-only headers144484
Node: Differences from previous versions146205
Node: Invocation150274
Ref: -MF158868
Node: Environment Variables171831
Node: GNU Free Documentation License175037
Node: Index of Directives197460
Node: Option Index199389
Node: Concept Index204980

End Tag Table

View File

@ -80,4 +80,17 @@ main input file is omitted.
@ifclear cppmanual
@xref{Preprocessor Options}.
@end ifclear
@item CPP_RESTRICTED
@cindex only open regular files
If this variable is defined, cpp will skip any include file which is not a
regular file, and will continue searching for the requested name (this is
always done if the found file is a directory).
@ifset cppmanual
@xref{Invocation}.
@end ifset
@ifclear cppmanual
@xref{Preprocessor Options}.
@end ifclear
@end vtable