CPP(1)
β¨ CPP(1) from GNU β¨
Okay bestie, this is the manual page for cpp, and it's giving main character energy π Let's get into it π
πΈ NAME
cpp - The C Preprocessor π§
π§ SYNOPSIS
cpp [-Dmacro[=defn]...] [-Umacro]
[-Idir...] [-iquotedir...]
[-M|-MM] [-MG] [-MF filename]
[-MP] [-MQ target...]
[-MT target...]
infile [[-o] outfile]
Only the most useful options are up top, so don't panic π There's a fuller list of preprocessor-specific options down below. cpp also takes most gcc driver options, but those aren't listed here, so check the GCC documentation for the details π
π DESCRIPTION
Okay so the C preprocessor, aka cpp, is a macro processor that the C compiler runs automatically to transform your program before it gets compiled β¨ It's called a macro processor because it lets you define macros, which are brief abbreviations for longer constructs π¦
The C preprocessor is meant to be used only with C, C++, and Objective-C source code. People have abused it as a general text processor in the past, and it will choke on input that doesn't follow C's lexical rules π For example, apostrophes get read as the start of character constants and cause errors. You also can't count on it keeping characteristics of the input that don't matter to C-family languages. If a Makefile gets preprocessed, all the hard tabs will be removed, and the Makefile won't work π
Having said that, you can often get away with using cpp on things that aren't C. Other Algol-ish programming languages are usually safe (Ada, etc.) and assembly is safe too, with caution π«Ά -traditional-cpp mode preserves more white space and is otherwise more permissive. Most of the problems can be avoided by writing C or C++ style comments instead of native language comments, and by keeping macros simple π
Wherever possible, you should use a preprocessor geared to the language you're writing in. Modern versions of the GNU assembler have macro facilities, and most high level programming languages have their own conditional compilation and inclusion mechanism. If all else fails, try a true general text processor, such as GNU M4 π
C preprocessors vary in some details. This manual talks about the GNU C preprocessor, which provides a small superset of the features of ISO Standard C. In its default mode, the GNU C preprocessor skips a few things the standard requires. These are features that are rarely, if ever, used, but they can cause surprising changes to the meaning of a program that doesn't expect them π
Heads up: to get strict ISO Standard C, use the-std=c90,-std=c99,-std=c11or-std=c17options, depending on which version of the standard you want. To get all the mandatory diagnostics, you must also use-pedantic. β οΈ
This manual describes the behavior of the ISO preprocessor. To minimize gratuitous differences, the traditional preprocessor should behave the same way wherever the ISO preprocessor's behavior doesn't conflict with traditional semantics. The differences that do exist are detailed in the section Traditional Mode π
For clarity, unless noted otherwise, references to CPP in this manual mean GNU CPP π§
π OPTIONS
The cpp command expects two file names as arguments, infile and outfile. The preprocessor reads infile together with any other files it pulls in with #include, and all the output from those combined input files gets written to outfile π
Either infile or outfile can be -. As infile, it means read from standard input, and as outfile, it means write to standard output. If either file is left out, it works the same as if - had been given for that file. You can also use the -o outfile option to pick the output file β¨
Unless otherwise noted, or the option ends in =, every option that takes an argument can have that argument right after the option or with a space in between. -Ifoo and -I foo do the exact same thing π¦
Lowkey tricky: many options have multi-letter names, so you can't group multiple single-letter options together. -dM is very different from -d -M π
-D name,--define-macro=name,--define-macro nameβ Predefinesnameas a macro, with the definition1πΈ-D name=definition,--define-macro=name=definition,--define-macro name=definitionβ The contents ofdefinitionget tokenized and processed as if they showed up during translation phase three in a#definedirective. Important: the definition gets truncated by embedded newline characters π«Ά- If you're invoking the preprocessor from a shell (or something shell-like), you might need the shell's quoting syntax to protect characters like spaces that mean something in shell syntax π
- Want to define a function-like macro on the command line? Write its argument list with surrounding parentheses before the equals sign (if there is one). Parentheses mean something to most shells, so you should quote the option. With
shandcsh,-D'name(args...)=definition'works π§ -Dand-Uoptions are processed in the order they're given on the command line. All-imacros fileand-include fileoptions get processed after all-Dand-Uoptions π
-U name,--undefine-macro=name,--undefine-macro nameβ Cancels any previous definition ofname, whether it was built in or provided with a-Doption π ββοΈ-include file,--include=file,--include fileβ Processesfileas if#include "file"showed up as the first line of the primary source file. The first directory searched forfileis the preprocessor's working directory instead of the directory with the main source file. If it's not found there, it gets searched for in the rest of the#include "..."search chain as normal π- If you give multiple
-includeoptions, the files get included in the order they appear on the command line π
- If you give multiple
-imacros file,--imacros=file,--imacros fileβ Exactly like-include, except any output produced by scanningfileis thrown away. The macros it defines stay defined. This lets you grab all the macros from a header without also processing its declarations π°- All files given with
-imacrosget processed before all files given with-includeπ
- All files given with
-undefβ Don't predefine any system-specific or GCC-specific macros. The standard predefined macros stay defined π§Ό-pthreadβ Defines additional macros needed for using the POSIX threads library. Use this option consistently for both compilation and linking π§΅ It's supported on GNU/Linux targets, most other Unix derivatives, and also on x86 Cygwin and MinGW targets πΈ-M,--dependenciesβ Instead of outputting the result of preprocessing, this outputs a rule suitable formakethat describes the dependencies of the main source file. The preprocessor outputs one make rule containing the object file name for that source file, a colon, and the names of all the included files, including those that come from-includeor-imacroscommand-line options π¦- Unless you specify it explicitly (with
-MTor-MQ), the object file name is the source file's name with any suffix swapped for the object file suffix and any leading directory parts removed. If there are lots of included files, the rule gets split into several lines using\-newline. The rule has no commands π - This option does not suppress the preprocessor's debug output, such as
-dM. To avoid mixing that debug output with the dependency rules, you should explicitly specify the dependency output file with-MF, or use an environment variable likeDEPENDENCIES_OUTPUT. Debug output still gets sent to the regular output stream as normal π - Passing
-Mto the driver implies-E, and suppresses warnings with an implicit-wπ₯
- Unless you specify it explicitly (with
-MM,--user-dependenciesβ Like-M, but don't mention header files that are found in system header directories, or header files that get included, directly or indirectly, from such a header π- This implies that choosing angle brackets or double quotes in an
#includedirective doesn't, on its own, decide whether that header shows up in-MMdependency output π«Ά
- This implies that choosing angle brackets or double quotes in an
-MF fileβ When used with-Mor-MM, specifies a file to write the dependencies to. If no-MFswitch is given, the preprocessor sends the rules to the same place it would send preprocessed output π- When used with the driver options
-MDor-MMD,-MFoverrides the default dependency output file π - If
fileis-, the dependencies get written to stdout β¨
- When used with the driver options
-MG,--print-missing-file-dependenciesβ In conjunction with an option like-Mthat requests dependency generation,-MGassumes missing header files are generated files and adds them to the dependency list without raising an error. The dependency filename is taken directly from the#includedirective without prepending any path.-MGalso suppresses preprocessed output, since a missing header file makes that useless π- This feature is used in automatic updating of makefiles π§
-Mno-modulesβ Disables dependency generation for compiled module interfaces π«-MPβ This option instructs CPP to add a phony target for each dependency other than the main file, causing each one to depend on nothing. These dummy rules work around errorsmakegives if you remove header files without updating the Makefile to match π οΈ This is typical output:
test.o: test.c test.h
test.h:
-MT targetβ Changes the target of the rule emitted by dependency generation. By default CPP takes the name of the main input file, deletes any directory components and any file suffix such as.c, and appends the platform's usual object suffix. The result is the target π―- An
-MToption sets the target to be exactly the string you specify. If you want multiple targets, you can specify them as a single argument to-MT, or use multiple-MToptions π - For example,
-MT '$(objpfx)foo.o'might give:
- An
$(objpfx)foo.o: foo.c
-MQ targetβ Same as-MT, but it quotes any characters that are special to Make.-MQ '$(objpfx)foo.o'gives:
$$(objpfx)foo.o: foo.c
The default target is automatically quoted, as if it were given with -MQ π₯Ή
-MD,--write-dependenciesβ okay so this is basically-M -MF file, except-Eis NOT implied π«Ά The driver works out thefilename by itself, and it depends on whether you passed an-o:- If there's an
-o, the driver uses its argument and just adds a.dsuffix. - If there isn't one, it takes the input file's name, strips off any directory components and the suffix, and slaps a
.don the end. - If
-MDis used together with-E, any-oswitch is understood to specify the dependency output file. But if you use it without-E, each-ois understood to specify a target object file. - Since
-Eisn't implied,-MDcan make a dependency output file as a side effect of the compilation process. main character energy π₯
- If there's an
-MMD,--write-user-dependenciesβ same energy as-MD, but it only mentions your own header files πΈ and skips the system header files π-fpreprocessedβ tells the preprocessor "hey, this input is already preprocessed, don't redo it" π It suppresses things like macro expansion, trigraph conversion, escaped newline splicing, and processing of most directives. The preprocessor still recognizes and removes comments, so you can pass a file preprocessed with-Cto the compiler with zero drama. In this mode the integrated preprocessor is basically just a tokenizer for the front ends π§-fpreprocessedis implicit if the input file has one of the extensions.i,.iior.mi. Those are the extensions GCC uses for preprocessed files created by-save-tempsπ-fdirectives-onlyβ handles directives but does NOT expand macros π¦ Its behavior depends on-Eand-fpreprocessed:- With
-E, preprocessing is limited to handling directives such as"#define","#ifdef", and"#error". Other preprocessor operations, like macro expansion and trigraph conversion, are not performed. The-dDoption is also implicitly enabled. - With
-fpreprocessed, predefinition of command line and most builtin macros is disabled. Macros such as__LINE__, which are contextually dependent, are handled normally. This enables compilation of files previously preprocessed with-E -fdirectives-only. - With both
-Eand-fpreprocessed, the rules for-fpreprocessedtake precedence. This enables full preprocessing of files previously preprocessed with-E -fdirectives-only.
- With
-fdollars-in-identifiersβ lets$into identifiers π-fextended-identifiersβ accepts universal character names and extended characters in identifiers π This one's on by default for C99 (and later C standard versions) and C++.-fno-canonical-system-headersβ when preprocessing, leaves system header paths alone instead of shortening them with canonicalization π§Ή-fmax-include-depth=depthβ sets the max depth of nested#includes. The default is200π-fsearch-include-path[=kind]β looks for input files on the#includepath, not just the current directory π This is especially handy with C++20 modules, where both header units and module interface units need to be compiled directly, like so:
g++ -c -std=c++20 -fmodules -fsearch-include-path bits/stdc++.h bits/std.cc
kind defaults to user, which looks on the #include "..." search path. You can also explicitly specify system for the #include <...> search path β¨
-ftabstop=widthβ sets the distance between tab stops π This helps the preprocessor report correct column numbers in warnings or errors, even if tabs show up on the line. If the value is less than1or greater than100, the option is ignored. The default is8.-ftrack-macro-expansion[=level]β tracks token locations across macro expansions π΅οΈ This lets the compiler show diagnostics about the current macro expansion stack when a compile error happens inside a macro expansion. Heads up: using it makes the preprocessor and the compiler eat more memory π Thelevelparameter picks how precise the token location tracking is, so you can lower memory use if you need to:- Value
0oflevelde-activates this option. - Value
1tracks token locations in a degraded mode for minimal memory overhead. In this mode all tokens resulting from the expansion of an argument of a function-like macro have the same location. - Value
2tracks token locations completely. This value is the most memory hungry.
- Value
When this option is given no argument, the default parameter value is 2. Note that -ftrack-macro-expansion=2 is activated by default π
-fmacro-prefix-map=old=newβ when preprocessing files living in directoryold, expands the__FILE__and__BASE_FILE__macros as if the files lived in directorynewinstead πΊοΈ This can change an absolute path to a relative one by using.fornew, which can lead to more reproducible, location-independent builds. This option also affects__builtin_FILE()during compilation. See also-ffile-prefix-mapand-fcanon-prefix-map.-fexec-charset=charsetβ sets the execution character set, used for string and character constants π¬ The default isUTF-8.charsetcan be any encoding supported by the system'siconvlibrary routine.-fwide-exec-charset=charsetβ sets the wide execution character set, used for wide string and character constants π The default is one ofUTF-32BE,UTF-32LE,UTF-16BE, orUTF-16LE, whichever matches the width ofwchar_tand the big-endian or little-endian byte order being used for code generation. As with-fexec-charset,charsetcan be any encoding supported by the system'siconvlibrary routine. However, you will have problems with encodings that do not fit exactly inwchar_t. π-finput-charset=charsetβ sets the input character set, used for translating from the input file's character set to the source character set GCC uses π₯ If the locale doesn't specify one, or GCC can't get that info from the locale, the default isUTF-8. This can be overridden by either the locale or this command-line option. Currently the command-line option takes precedence if there's a conflict.charsetcan be any encoding supported by the system'siconvlibrary routine.-fworking-directoryβ turns on linemarkers in the preprocessor output that let the compiler know the current working directory at preprocessing time ποΈ When this is enabled, the preprocessor emits, after the initial linemarker, a second linemarker with the current working directory followed by two slashes. GCC uses this directory, when it's present in the preprocessed input, as the directory emitted as the current working directory in some debugging information formats. This option is implicitly enabled if debugging information is enabled, but you can inhibit that with the negated form-fno-working-directory. If the-Pflag is present in the command line, this option has no effect, since no#linedirectives are emitted whatsoever π-A predicate=answer,--assert predicate=answer,--assert=predicate=answerβ makes an assertion with the predicatepredicateand the answeranswerπ This is the form to use over the older-A predicate(answer)form, which is still supported, because it doesn't use shell special characters. Assertions are an obsolete feature of the preprocessor, supported only for compatibility with legacy system headers on some targets.-A -predicate=answer,--assert -predicate=answer,--assert=-predicate=answerβ cancels an assertion with the predicatepredicateand the answeranswerπ«-C,--commentsβ doesn't throw comments away π¬ All comments are passed through to the output file, except comments in processed directives, which get deleted along with the directive.
Be prepared for side effects when using-Cπ It causes the preprocessor to treat comments as tokens in their own right. For example, comments appearing at the start of what would be a directive line turn that line into an ordinary source line, since the first token on the line is no longer a#.
-CC,--comments-in-macrosβ doesn't discard comments, including during macro expansion β¨ This is like-C, except comments contained within macros are also passed through to the output file where the macro is expanded. On top of the side effects of-C,-CCconverts all C++-style comments inside a macro to C-style comments. This stops a later use of that macro from accidentally commenting out the rest of the source line. The-CCoption is generally used to support lint comments π§Ό-P,--no-line-commandsβ stops linemarkers from being generated in the preprocessor output π« This might be useful when running the preprocessor on something that isn't C code and will be sent to a program that might get confused by the linemarkers.-traditional,--traditional,-traditional-cpp,--traditional-cppβ tries to imitate pre-standard C preprocessors, as opposed to ISO C preprocessors π°οΈ GCC doesn't otherwise try to emulate a pre-standard C compiler, and these options are only supported with the-Eswitch, or when invokingCPPexplicitly.-trigraphs,--trigraphsβ supports ISO C trigraphs πΊ These are three-character sequences, all starting with??, that ISO C defines to stand for single characters. For example,??/stands for\, so'??/n'is a character constant for a newline. By default GCC ignores trigraphs, but in standard-conforming modes it converts them. See the-stdand-ansioptions.-remapβ enables special code to work around file systems that only allow super short file names, like MS-DOS π-H,--trace-includesβ prints the name of each header file used, alongside all the other normal activity π¦ Each name is indented to show how deep it sits in the#includestack. Precompiled header files get printed too, even when they turn out to be invalid: an invalid one shows up with...x, and a valid one with...!.-dletters,--dump=letters,--dump lettersβ okay so this one lets you ask for debugging dumps while compiling, and thelettersyou pass decide which dump you get πβ¨. The flags here are the preprocessor ones. Any other letters are handled by the actual compiler, reserved for future GCC versions, or quietly ignored, so no drama there π . β οΈ If you mix letters whose behaviour conflicts, the result is undefined, so please don't π-dM,--dump=Mβ instead of your normal output, you get a list of#definedirectives for every macro defined while the preprocessor runs, predefined ones included π. It's the best way to see what your preprocessor already has baked in. Assuming you don't have a file calledfoo.h, this command shows all the predefined macros:
touch foo.h; cpp -dM foo.h
-dD,--dump=Dβ same as-dM, but now you get the#definedirectives and the result of preprocessing. Both kinds of output go to standard output π-dN,--dump=Nβ like-dD, but only the macro names show up, not their expansions π«Ά-dI,--dump=Iβ adds#includedirectives to the result of preprocessing π¦-dU,--dump=Uβ like-dD, except only macros that get expanded, or whose existence gets tested in preprocessor directives, are output π. The output waits until that macro is used or tested, and#undefdirectives are also output for macros that were tested but were undefined at that moment π§
-fdebug-cppβ this one is only really useful if you're debugging GCC itself π. When you use it fromCPPor with-E, it dumps debugging info about location maps, and every token in the output gets the dump of the map its location belongs to π₯. When you use it from GCC without-E, it does absolutely nothing π-I dir,-iquote dir,-isystem dir,-idirafter dir,--include-directory-after=dir,--include-directory-after dir,--include-directory=dir,--include-directory dirβ this is how you tell the compiler about extra directories to hunt through for header files during preprocessing ποΈ.--include-directoryis just another name for-I, and--include-directory-afteris another name for-idirafterπ
If dir starts with = or $SYSROOT, that bit gets swapped out for the sysroot prefix. Check out --sysroot and -isysroot for the deets πΈ
Heads up on the scope here: -iquote directories only apply to the quote form of the directive, "#include "file"". -I, -isystem, and -idirafter directories apply to both "#include "file"" and #include <file> lookups π
You can stack as many of these as you want to search several directories. The lookup order goes like this:
- For the quote form of the include directive, the directory of the current file gets searched first π₯
- For the quote form, the
-iquotedirectories are searched left to right, in the order they show up on the command line π₯ -Idirectories are scanned left to right π₯-isystemdirectories are scanned left to right π«§- Standard system directories are scanned ποΈ
-idirafterdirectories are scanned left to right, last but not least π
You can use -I to override a system header and swap in your own version, since these directories get searched before the standard system header directories π
. β οΈ But please don't use -I to add directories full of vendor-supplied system headers. That's what -isystem is for π
-isystem and -idirafter also mark the directory as a system directory, so it gets the same special treatment as the standard system directories β¨
Now, if a standard system include directory, or a directory given with -isystem, is also given with -I, the -I option gets ignored. The directory still gets searched, just as a system directory in its normal spot in the system include chain. This is so GCC's procedure for fixing buggy system headers and the ordering for the #include_next directive don't get messed up by accident π. If you truly need to change the search order for system directories, use the -nostdinc and/or -isystem options instead π«Ά
-I-,--include-barrierβ this splits the include path, but it's been deprecated, so please don't build your life around it π. Use-iquoteinstead for the-Idirectories that come before-I-, then remove-I-entirely π§Ή
Any directories given with -I before -I- only get searched for headers requested with "#include "file"". They don't get searched for #include <file>. If you add more -I directories after the -I-, those get searched for all #include directives π¦
-I- also stops the directory of the current file from being used as the first search directory for "#include "file"". There's no way to override that effect of -I- π€
-iprefix prefix,--include-prefix=prefix,--include-prefix prefixβ setsprefixas the prefix for any later-iwithprefixoptions π. If the prefix is a directory, include the final/π-iwithprefix dir,-iwithprefixbefore dir,--include-with-prefix=prefix,--include-with-prefix prefix,--include-with-prefix-after=prefix,--include-with-prefix-after prefix,--include-with-prefix-before=prefix,--include-with-prefix-before prefixβ this tacksdironto the prefix you set earlier with-iprefix, then adds the resulting directory to the include search path π€οΈ.-iwithprefixbeforeputs it in the same spot-Iwould, while-iwithprefixputs it where-idirafterwould π
--include-with-prefix and --include-with-prefix-after are both aliases for -iwithprefix, and --include-with-prefix-before is an alias for -iwithprefixbefore π
-isysroot dirβ this is basically--sysroot, but it only applies to header files. The exception is Darwin targets, where it applies to both header files and libraries π. Check the--sysrootoption for the full story β¨-imultilib dirβ usesdiras a subdirectory of the directory that holds target-specific C++ headers π§-imultiarch dirβ usesdiras a subdirectory of the directory that holds architecture-specific C++ headers πΈ-nostdinc,--no-standard-includesβ no more searching the standard system directories for header files π ββοΈ. Only the directories you explicitly gave with-I,-iquote,-isystem, and/or-idirafterget searched, plus the directory of the current file if it's relevant π-nostdinc++β skips the C++-specific standard directories when hunting for headers, but still searches the other standard directories π«Ά. (This one gets used when building the C++ library, so it's very much a behind-the-scenes kind of flag π οΈ)--embed-dir=dir,--embed-directory=dir,--embed-directory dirβ addsdirto the list of searched directories for the#embedpreprocessing directive or the__has_embedmacro πͺ. There are no default directories for#embed, so you're on your own with this one π₯Ή
If dir starts with = or $SYSROOT, that gets swapped for the sysroot prefix, same as before. See --sysroot and -isysroot π·
-Wcomment,-Wcommentsβ warns whenever a comment-start sequence/*shows up inside a/* comment, or whenever a backslash-newline shows up in a//comment π. This warning is enabled by-Wallπ-Wtrigraphsβ warns if any trigraphs show up that might change what your program means π΅οΈββοΈ. Trigraphs inside comments don't get warned about, except the ones that would form escaped newlines π
This option is implied by -Wall. If -Wall isn't given, this option is still enabled unless trigraphs are enabled. Want trigraph conversion without the warnings but still get the other -Wall warnings? Use -trigraphs -Wall -Wno-trigraphs π
-Wundefβ warns if an undefined identifier gets evaluated in an#ifdirective π. Those identifiers get replaced with zero, so keep an eye out π«£-Wexpansion-to-definedβ warns wheneverdefinedshows up in the expansion of a macro, including when the macro gets expanded by an#ifdirective π. That usage isn't portable, so this one is a whole vibe check π«. This warning is also enabled by-Wpedanticand-Wextraβ¨-Wunused-macrosβ warns about macros defined in the main file that never get used π§Ή. A macro counts as used if it gets expanded or tested for existence at least once π₯°. The preprocessor also warns if the macro hasn't been used by the time it gets redefined or undefined π¬
Built-in macros, macros defined on the command line, and macros defined in include files don't get warned about π
Note: If a macro is actually used, but only used in skipped conditional blocks, the preprocessor reports it as unused. To dodge the warning in that case, you could improve the scope of the macro's definition, for example by moving it into the first skipped block π§ . Or, you could provide a dummy use with something like this:
#if defined the_macro_causing_the_warning
#endif
-Wno-endif-labelsβ stops the warning for when an#elseor an#endifis followed by text π·οΈ. This happens sometimes in older programs with code like this:
#if FOO
...
#else FOO
...
#endif FOO
The second and third FOO should really be in comments π¬. This warning is on by default π
β¨ ENVIRONMENT β¨
okay so this section is all about the environment variables that change how CPP behaves πΈ you can use them to point at directories or prefixes for hunting down include files, or to control dependency output π₯
ngl, you can also pass search places with options like -I, and control dependency output with options like -M. These take precedence over environment variables, and environment variables take precedence over the configuration of GCC π so the pecking order is options, then env vars, then GCC config π
CPATH, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, OBJC_INCLUDE_PATH ποΈ
each of these holds a list of directories, separated by a special character (much like PATH π¦), and CPP looks in them for header files. That separator is PATH_SEPARATOR, and it's target-dependent, decided when GCC gets built π§ it's a semicolon on Microsoft Windows-based targets and a colon on almost everything else β¨
CPATHβ searched as if you'd typed-I, but after any-Ipaths on the command line. This one gets used no matter which language is being preprocessed πC_INCLUDE_PATH,CPLUS_INCLUDE_PATH,OBJC_INCLUDE_PATHβ these only apply when preprocessing the matching language. Each is searched as if you'd typed-isystem, but after any-isystempaths on the command line π
in all of these, an empty element tells the compiler to search its current working directory π empty elements can go at the beginning or end of a path. For example, if CPATH is ":/special/include", that's the exact same as -I. -I/special/include π«Ά
DEPENDENCIES_OUTPUT π
if this is set, its value tells CPP how to output Make dependencies for the non-system header files it processes. System header files get ignored in this output π
the value can be just a file name, in which case the Make rules get written to that file, and the target name is guessed from the source file name. Or the value can look like file target, in which case the rules are written to file and target is used as the target name π
in other words, this variable is the same as combining -MM and -MF, with an optional -MT switch too π
SUNPRO_DEPENDENCIES πΈ
this one is basically DEPENDENCIES_OUTPUT, except system header files are not ignored π³ so it implies -M rather than -MM. However, the dependence on the main input file is omitted π
SOURCE_DATE_EPOCH β°
if this is set, its value is a UNIX timestamp used instead of the current date and time in the "__DATE__" and "__TIME__" macros, so the embedded timestamps stay reproducible π
the value must be a UNIX timestamp, which means the number of seconds (excluding leap seconds) since 01 Jan 1970 00:00:00, written in ASCII. It's identical to the output of date +%s on GNU/Linux and other systems that support the %s extension in the "date" command π°οΈ
the value should be a known timestamp, like the last modification time of the source or package, and it should be set by the build process. Don't just wing it! π¨
π SEE ALSO π
gpl(7), gfdl(7), fsf-funding(7), gcc(1), and the Info entries for cpp and gcc π¦
βοΈ COPYRIGHT βοΈ
Copyright (c) 1987-2026 Free Software Foundation, Inc.
okay the legal stuff, but make it cute π you're allowed to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation. A copy of the license is included in the man page gfdl(7). 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. π
bestie, that's the whole CPP page π GCC 16 energy, last dated March 22nd, 2026, and you are now officially dangerous with CPATH β¨ππ
π¦ where this page comes from
- ubuntu resolute: cpp-16-s390x-linux-gnu 16-20260322-1ubuntu1cross1
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms