Name

cpp

Synopsis

cpp [options] [ifile [ofile]]

GNU C language preprocessor. cpp is normally invoked as the first pass of any C compilation by the gcc command. The output of cpp is a form acceptable as input to the next pass of the C compiler. The ifile and ofile options are, respectively, the input and output for the preprocessor; they default to standard input and standard output.

Options

-$

Do not allow $ in identifiers.

-ansi

Use 1990 ISO C standard. This is equivalent to -std=c89.

-dD

Similar to -dM, but exclude predefined macros and include results of preprocessing.

-dM

Suppress normal output. Print series of #defines that create the macros used in the source file.

-dN

Similar to -dD, but don’t print macro expansions.

-dI

Print #include directives in addition to other output.

-fpreprocessed

Treat file as already preprocessed. Skip most processing directives, remove all comments, and tokenize file.

-ftabstop=width

Set distance between tabstops so columns will be reported correctly in warnings and errors. Default is 8.

-fno-show-column

Omit column numbers in warnings and errors.

-gcc

Define _ _GNUC_ _, _ _GNUC_MINOR_ _, and _ _GNUC_PATCHLEVEL_ _ macros.

--help

Print usage message and exit.

-idirafter dir

Search dir for header files when a header file is not found in any of the included directories.

-imacros file

Process macros in file before processing main files.

-include file

Process file before main file.

-iprefix prefix

When adding directories with -iwithprefix, prepend prefix to the directory’s name.

-isystem ...

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.