LinuxCommandLibrary

clang-cpp

Clang C/C++ preprocessor

TLDR

Run the C preprocessor on a source file

$ clang-cpp [source.c]
copy
Preprocess with defines
$ clang-cpp -D[MACRO]=[value] [source.c]
copy
Preprocess with include path
$ clang-cpp -I[/path/to/includes] [source.c]
copy
Output to file
$ clang-cpp [source.c] -o [output.i]
copy

SYNOPSIS

clang-cpp [options] file

DESCRIPTION

clang-cpp is the Clang C preprocessor. It handles #include directives, macro expansion, and conditional compilation, outputting the preprocessed source.
This is the LLVM/Clang equivalent of cpp from GCC.

PARAMETERS

-D macro[=value]

Define a preprocessor macro.
-U macro
Undefine a preprocessor macro.
-I path
Add include search path.
-o file
Write output to file.
-E
Preprocess only (implied).

SEE ALSO

clang(1), cpp(1), clang++(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community