CPP(1)
๐ cpp: manual page, section 1, from GNU ๐
๐ธ 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]
okay so this is the quick glance version ๐ Only the most useful options are up there, bestie. For a more complete list of preprocessor-specific options, check below. Also, cpp takes most gcc driver options too, which I'm not listing here, so go to the GCC documentation if you need those details ๐
๐ฆ DESCRIPTION ๐ฆ
The C preprocessor, aka cpp, is a macro processor ๐ง The C compiler uses it automatically to transform your program before compilation. It's called a macro processor because it lets you define macros, which are short abbreviations for longer constructs. Iconic behavior, honestly ๐
The C preprocessor is meant to be used only with C, C++, and Objective-C source code. In the past, people have abused it as a general text processor ๐ญ It will choke on input that doesn't follow C's lexical rules. For example, apostrophes get treated as the start of character constants, and that causes errors ๐ You also can't count on it keeping the characteristics of your input that don't matter to C-family languages. If you preprocess a Makefile, all the hard tabs get removed, and the Makefile won't work anymore. Not me being shocked ๐
Having said that, you can lowkey get away with using cpp on things that aren't C. Other Algol-ish languages are usually safe (Ada, etc.) Assembly is also fine, but be careful ๐ -traditional-cpp mode preserves more white space and is otherwise more permissive โจ Most of the problems can be dodged by writing C or C++ style comments instead of native language comments, and by keeping your macros simple ๐ซถ
Whenever you can, use a preprocessor that's built for the language you're writing in ๐ Modern versions of the GNU assembler have macro facilities. Most high level programming languages have their own conditional compilation and inclusion mechanism. And if all else fails, try a true general text processor, like GNU M4. Main character energy for real ๐
C preprocessors vary in some details. This manual covers the GNU C preprocessor, which gives you 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 ๐ If you want strict ISO Standard C, use -std=c90, -std=c99, -std=c11 or -std=c17, depending on which version of the standard you want. To get all the mandatory diagnostics, you also have to use -pedantic ๐ฅ
This manual describes the behavior of the ISO preprocessor. To cut down on gratuitous differences, wherever the ISO preprocessor's behavior doesn't clash with traditional semantics, the traditional preprocessor should act the same way. The differences that do exist are detailed in the section Traditional Mode ๐ฆ
For clarity, unless noted otherwise, any mention of CPP in this manual means GNU CPP ๐
โจ OPTIONS โจ
Okay so the cpp command expects two file names as arguments: infile and outfile. The preprocessor reads infile, along with any other files it pulls in with #include. All the output from the combined input files gets written to outfile ๐
Either infile or outfile can be -. As infile, it means read from standard input. 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 specify the output file ๐
Unless noted otherwise, or unless the option ends in =, every option that takes an argument can have that argument right after the option, or with a space between the option and the argument. -Ifoo and -I foo do the exact same thing ๐
Lots of options have multi-letter names, so you can't group multiple single-letter options together. -dM is very different from -d -M ๐ญ
-D nameโ Predefinesnameas a macro, with the definition1๐ง-D name=definitionโ The contents ofdefinitionget tokenized and processed as if they showed up during translation phase three in a#definedirective. Specifically, the definition gets cut off at any embedded newline characters โ๏ธ
If you're running the preprocessor from a shell or shell-like program, you might need the shell's quoting syntax to protect characters like spaces, since those mean something in shell syntax ๐
Want to define a function-like macro on the command line? Write its argument list in surrounding parentheses before the equals sign (if there is one). Parentheses mean something to most shells, so make sure you quote the option. With sh and csh, -D'name(args...)=definition' works ๐
-D and -U options get processed in the order they're given on the command line. All -imacros file and -include file options get processed after all the -D and -U options ๐
-U nameโ Cancels any previous definition ofname, whether it was built in or provided with a-Doption ๐งน-include fileโ Processesfileas if#include "file"appeared as the first line of the primary source file. Here's the twist though: the first directory searched forfileis the preprocessor's working directory, not the directory containing the main source file. If it's not found there, it gets searched for in the rest of the#include "..."search chain, like normal ๐
If you give multiple -include options, the files get included in the order they show up on the command line ๐
-imacros fileโ Exactly like-include, except any output produced by scanningfilegets thrown away. The macros it defines stay defined. This lets you grab all the macros from a header without also processing its declarations ๐ซง
Every file specified by -imacros gets processed before every file specified by -include ๐
-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โ 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. That includes files coming from-includeor-imacroscommand-line options ๐
Unless you set it explicitly (with -MT or -MQ), the object file name is the source file name with any suffix swapped for the object file suffix, and with any leading directory parts removed ๐ฆ If there are a lot of included files, the rule gets split across several lines using \-newline. The rule has no commands ๐
This option does not suppress the preprocessor's debug output, like -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 like DEPENDENCIES_OUTPUT. Debug output still goes to the regular output stream like normal ๐
Passing -M to the driver implies -E, and suppresses warnings with an implicit -w ๐คซ
-MMโ Like-M, but doesn't mention header files found in system header directories, or header files included, directly or indirectly, from one of those headers ๐ฟ
This means the choice of angle brackets or double quotes in an #include directive doesn't, on its own, decide whether that header shows up in -MM dependency output ๐
-MF fileโ When used with-Mor-MM, this specifies a file to write the dependencies to. If you don't give a-MFswitch, the preprocessor sends the rules to the same place it would send preprocessed output ๐ฌ
When used with the driver options -MD or -MMD, -MF overrides the default dependency output file ๐ซถ
If file is -, the dependencies get written to stdout โจ
-MGโ Used together 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 tells CPP to add a phony target for each dependency other than the main file, so that each one depends on nothing. These dummy rules work around errors thatmakegives if you remove header files without updating the Makefile to match ๐ฆ
Typical output looks like this:
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 like.c, and appends the platform's usual object suffix. That result is the target ๐ฏ
An -MT option sets the target to be exactly the string you specify. If you want multiple targets, you can give them as a single argument to -MT, or use multiple -MT options ๐
For example, -MT '$(objpfx)foo.o' might give:
$(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 had been given with -MQ ๐
-MDโ-MDis equivalent to-M -MF file, except that-Eis not implied. The driver figures outfilebased on whether an-ooption is given. If it is, the driver uses its argument but with a suffix of.d. Otherwise, it takes the name of the input file, removes any directory components and suffix, and applies a.dsuffix ๐
If -MD is used together with -E, any -o switch is understood to specify the dependency output file. But if it's used without -E, each -o is understood to specify a target object file ๐
Since -E is not implied, -MD can generate a dependency output file as a side effect of the compilation process. Multitasking queen behavior ๐
-MMDโ Same deal as-MD, but bestie, it only mentions your own user header files and skips the system ones ๐ง-fpreprocessedโ This tells the preprocessor that your input has already been preprocessed โจ So it skips macro expansion, trigraph conversion, escaped newline splicing, and most directives. It still removes comments though, so you can pass along a file made with-Cto the compiler with zero drama. In this mode the integrated preprocessor is basically just a tokenizer for the front ends ๐- It's switched on automatically if your input file ends in
.i,.iior.mi. Those are the extensions GCC uses for preprocessed files made by-save-temps๐ฆ
- It's switched on automatically if your input file ends in
-fdirectives-onlyโ When preprocessing, it handles directives but does not expand macros ๐ธ How it acts depends on-Eand-fpreprocessed:- With
-E, preprocessing is limited to directives like"#define","#ifdef", and"#error". Macro expansion and trigraph conversion don't happen. The-dDoption also gets turned on automatically ๐ - With
-fpreprocessed, predefinition of command line and most builtin macros is disabled. Contextual macros like"__LINE__"are handled normally. This lets you compile files that were previously preprocessed with"-E -fdirectives-only"๐ซถ - With both
-Eand-fpreprocessed, the-fpreprocessedrules win ๐ This gives you full preprocessing of files that were earlier preprocessed with"-E -fdirectives-only"๐ญ
- With
-fdollars-in-identifiersโ Lets$show up inside identifiers ๐-fextended-identifiersโ Lets identifiers use universal character names and extended characters ๐ This one is on by default for C99 (and later C standards) and C++ โจ-fno-canonical-system-headersโ When preprocessing, your system header paths won't get shortened through canonicalization ๐-fmax-include-depth=depthโ Sets how deep nested#includes can go ๐ง The default is200.-fsearch-include-path[=kind]โ Looks for input files on the#includepath, not just in the current directory ๐ฅ This is super handy with C++20 modules, where header units and module interface units both need to be compiled directly:
g++ -c -std=c++20 -fmodules -fsearch-include-path bits/stdc++.h bits/std.cc
kinddefaults touser, which searches the#include "..."path ๐ You can also explicitly ask forsystemto search the#include <...>path โจ
-ftabstop=widthโ Sets the distance between tab stops ๐ This helps the preprocessor report correct column numbers in warnings or errors, even when there are tabs on the line ๐ If the value is less than1or greater than100, the option gets ignored. The default is8.-ftrack-macro-expansion[=level]โ Tracks where tokens are located across macro expansions ๐ This lets the compiler show the current macro expansion stack when an error pops up inside a macro ๐ญ Heads up though: using it makes the preprocessor and the compiler eat more memory ๐ Thelevelparameter lets you pick how precisely token locations get tracked, so you can dial down the memory use if you need to:0turns this option off ๐1tracks token locations in a degraded mode to keep memory overhead minimal. In this mode, every token coming from expanding a function-like macro's argument shares the same location ๐ซ2tracks token locations completely. This is the most memory hungry setting ๐ท- If you give the option with no argument, the level defaults to
2๐
Also, -ftrack-macro-expansion=2 is turned on by default, so it's already working for you ๐
-fmacro-prefix-map=old=newโ When you preprocess files living in the directoryold, the"__FILE__"and"__BASE_FILE__"macros expand as if those files lived in directorynewinstead ๐ฆ You can use this to turn an absolute path into a relative one by using.fornew, which can lead to more reproducible, location-independent builds ๐ It also affects"__builtin_FILE()"during compilation. See also-ffile-prefix-mapand-fcanon-prefix-map๐-fexec-charset=charsetโ Sets the execution character set, which is used for string and character constants โจ The default is UTF-8. Thecharsetcan be any encoding your system's"iconv"library routine supports ๐-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 of"wchar_t"and the big-endian or little-endian byte order being used for code generation ๐ง Just like-fexec-charset, thecharsetcan be any encoding your system's"iconv"routine supports. Fair warning though: you'll run into problems with encodings that don't fit exactly into"wchar_t"โ ๏ธ-finput-charset=charsetโ Sets the input character set, which gets translated from your input file's character set into the source character set GCC uses ๐ซถ If the locale doesn't say what to use, or GCC can't get that info from the locale, the default is UTF-8. The locale or this command-line option can override it, but if they conflict, the command-line option wins ๐ Thecharsetcan be any encoding your system's"iconv"library routine supports ๐-fworking-directoryโ Turns on linemarkers in the preprocessor output so the compiler knows the working directory at the time of preprocessing ๐ When it's enabled, the preprocessor emits a second linemarker right after the first one. That one has the current working directory followed by two slashes ๐ GCC uses this directory, when it shows up in the preprocessed input, as the directory listed as the current working directory in some debugging info formats ๐ This option is switched on automatically if debugging info is enabled, but you can block it with the negated form-fno-working-directory๐ Also, if-Pis in your command line, this option does nothing, since no"#line"directives get emitted whatsoever ๐-A predicate=answerโ Makes an assertion with the predicatepredicateand the answeranswer๐ This form is preferred over the older-A predicate(answer)form. That one still works, but this version doesn't use shell special characters, so it's way less messy ๐-A -predicate=answerโ Cancels an assertion with the predicatepredicateand the answeranswer๐-Cโ Don't throw away comments ๐ฌ All comments get passed through to the output file, except comments inside processed directives, which get deleted along with the directive ๐๏ธ
Be ready for side effects with-C! It makes the preprocessor treat comments as tokens in their own right. For example, a comment at the start of what would be a directive line turns that line into an ordinary source line, since the first token on the line is no longer a#๐ญ
-CCโ Don't throw away comments, even during macro expansion ๐ซถ This is like-C, except comments inside macros also get passed through to the output file wherever the macro gets expanded โจ- On top of the
-Cside effects,-CCconverts every C++-style comment inside a macro into a C-style comment. This stops a later use of that macro from accidentally commenting out the rest of the source line ๐ก๏ธ -CCis generally used to support lint comments ๐งน
- On top of the
-Pโ Stops linemarkers from showing up in the preprocessor output ๐ซ This might come in handy when you're running the preprocessor on something that isn't C code and will get sent to a program that could get confused by the linemarkers ๐ธ-traditional,-traditional-cppโ Tries to imitate the behavior of pre-standard C preprocessors instead of ISO C preprocessors ๐ฆ- GCC doesn't otherwise try to pretend to be a pre-standard C compiler, and these options are only supported with the
-Eswitch or when you invokeCPPexplicitly ๐
- GCC doesn't otherwise try to pretend to be a pre-standard C compiler, and these options are only supported with the
-trigraphsโ Supports ISO C trigraphs ๐บ These are three-character sequences that all start with??, and ISO C defines them 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. Check out the
-stdand-ansioptions ๐
- By default GCC ignores trigraphs, but in standard-conforming modes it converts them. Check out the
-remapโ Turns on special code to work around file systems that only allow super short file names, like MS-DOS ๐-Hโ Prints the name of each header file used, on top of all the other normal stuff ๐ง Each name is indented to show how deep it sits in the#includestack ๐ช Precompiled header files get printed too, even if they turn out to be invalid. An invalid one shows up with...x, and a valid one shows up with...!โ-dlettersโ Makes debugging dumps during compilation, as specified byletters๐ The flags documented here are the ones relevant to the preprocessor. Other letters are either interpreted by the compiler proper, or reserved for future GCC versions, so they get silently ignored ๐คซ If you specify letters whose behavior conflicts, the result is undefined โ ๏ธ-dMโ Instead of the normal output, this generates a list of#definedirectives for all the macros defined while the preprocessor runs, including predefined macros ๐ It's a great way to see what's predefined in your version of the preprocessor. Assuming you have no filefoo.h, this command shows all the predefined macros:
touch foo.h; cpp -dM foo.h
-dDโ Like-dM, except it outputs both the#definedirectives and the result of preprocessing ๐ Both kinds of output go to the standard output file ๐ซถ-dNโ Like-dD, but only emits the macro names, not their expansions ๐-dIโ Outputs#includedirectives in addition to the result of preprocessing ๐ฅ-dUโ Like-dD, except only macros that get expanded, or whose definedness gets tested in preprocessor directives, are output ๐ฆ The output is delayed until the macro is used or tested.#undefdirectives are also output for macros that were tested but were undefined at that time ๐
-fdebug-cpp ๐ Okay so this one is strictly for debugging GCC itself, bestie ๐ When you use it from CPP or alongside -E, it dumps debugging info about location maps. Every token in the output gets the dump of whatever map its location belongs to. โจ
When you use it from GCC without -E, it does absolutely nothing. Zero effect. ๐
-I dir,-iquote dir,-isystem dir,-idirafter dirโ okay this is the big header-hunting crew ๐ฆ Each one adds dir to the list of places CPP searches for header files during preprocessing.
If dir starts with = or $SYSROOT, that bit gets swapped out for the sysroot prefix. See --sysroot and -isysroot for the tea on that. โ
-iquote dirs only apply to the quote form, #include "file". Meanwhile -I, -isystem, and -idirafter dirs apply to both #include "file" and #include <file>. ๐
You can stack as many of these as you want to search a bunch of folders. The lookup order goes like this:
- For the quote form, the directory of the current file gets checked first. ๐
- For the quote form, the
-iquotedirs get searched left-to-right, in the order they show up on the command line. ๐ -Idirs get scanned left-to-right. ๐ธ-isystemdirs get scanned left-to-right. ๐ง- The standard system dirs get scanned. ๐๏ธ
-idirafterdirs get scanned left-to-right. ๐
You can use -I to override a system header and swap in your own version, since those dirs get searched before the standard system ones. BUT, and this is important, do NOT use -I to add dirs full of vendor-supplied system headers. Use -isystem for that. ๐
โโ๏ธ
-isystem and -idirafter also mark the dir as a system directory, so it gets the same special treatment the standard system dirs get. ๐
If a standard system include dir, or a dir you gave to -isystem, is also given with -I, then the -I gets ignored. The dir still gets searched, just as a system dir in its normal spot in the system include chain. This keeps GCC's procedure for fixing buggy system headers and the ordering for #include_next from getting messed up by accident. If you truly need to change the search order for system dirs, use -nostdinc and/or -isystem instead. ๐ซถ
-I-โ ugh, this one's a little drama ๐ญ It splits the include path, and it's deprecated. Please use-iquoteinstead for the-Idirs that come before the-I-, then delete the-I-entirely. ๐๏ธ
Any dirs given with -I before -I- only get searched for headers requested with #include "file". They are NOT searched for #include <file>. If you add more -I dirs after the -I-, those get searched for every #include directive.
On top of that, -I- stops the directory of the current file from being the first place searched for #include "file". There's no way to undo that effect, so choose wisely. ๐
-iprefix prefixโ sets prefix as the prefix for any-iwithprefixoptions that come after it. If the prefix is a directory, make sure you include the final/. ๐-iwithprefix dir,-iwithprefixbefore dirโ tacks dir onto the prefix you set earlier with-iprefix, then adds the result to the include search path. โจ-iwithprefixbeforeputs it in the same spot-Iwould, while-iwithprefixputs it where-idirafterwould. ๐ง-isysroot dirโ basically the same vibe as--sysroot, but it only applies to header files. The exception is Darwin targets, where it applies to both headers and libraries. Check out--sysrootfor more info. ๐-imultilib dirโ uses dir as a subdirectory of the directory that holds the target-specific C++ headers. ๐-nostdincโ no standard system dirs for header hunting, bestie ๐ โโ๏ธ Only the dirs you explicitly pass with-I,-iquote,-isystem, and/or-idirafterget searched, plus the directory of the current file if it applies. ๐-nostdinc++โ skips the C++-specific standard dirs, but still searches the other standard ones. (This one's used when building the C++ library, so it's very behind-the-scenes energy ๐ง)--embed-dir=dirโ appends dir to the list of searched directories for the#embedpreprocessing directive or the__has_embedmacro. There are no default directories for#embed, so you have to bring your own. ๐ฆ
If dir starts with = or $SYSROOT, that gets replaced with the sysroot prefix, same as before. See --sysroot and -isysroot. โจ
-Wcomment,-Wcommentsโ warns whenever a/*shows up inside a/* comment, or whenever a backslash-newline shows up in a//comment. This one's turned on by-Wall. ๐ฅ-Wtrigraphsโ warns if any trigraphs get encountered that might change what the program means. Trigraphs inside comments don't get warned about, EXCEPT the ones that would form escaped newlines. ๐
This is implied by -Wall. If -Wall isn't given, it's still enabled unless trigraphs are enabled. Want trigraph conversion without the warnings but still want 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. ๐งฎ-Wexpansion-to-definedโ warns wheneverdefinedshows up in the expansion of a macro, including when the macro gets expanded by an#ifdirective. This usage isn't portable, so it's a red flag, babe ๐ฉ 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's expanded or tested for existence at least once. The preprocessor also warns if a 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 are NOT warned about. ๐ โโ๏ธ
Heads up: if a macro is actually used, but ONLY in skipped conditional blocks, the preprocessor still reports it as unused. To dodge the warning in that case, you might improve the scope of the macro's definition, like moving it into the first skipped block. Or you could give it 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 be in comments. ๐ซ This warning is on by default.
๐ธ ENVIRONMENT ๐ธ
Okay this section is all about the environment variables that change how CPP operates โจ You can use them to specify directories or prefixes for searching include files, or to control dependency output. ๐
Also, you can specify places to search with options like -I, and control dependency output with options like -M. Those take precedence over environment variables, and environment variables take precedence over the configuration of GCC. Pecking order, babe ๐
๐๏ธ CPATH, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, OBJC_INCLUDE_PATH
Each one of these has a value that's a list of directories, separated by a special character, kind of like PATH. Those directories are where it looks for header files. The special character, PATH_SEPARATOR, depends on the target and gets decided when GCC is built. For Microsoft Windows-based targets it's a semicolon, and for pretty much everything else it's a colon. ๐
CPATH specifies a list of directories to be searched as if you'd given them with -I, but after any paths you gave with -I options on the command line. This variable gets used no matter which language is being preprocessed. ๐ฆ
The remaining variables only apply when preprocessing the particular language they're named after. Each one specifies a list of directories to be searched as if you'd given them with -isystem, but after any paths you gave with -isystem options on the command line. ๐ง
In all of these variables, an empty element tells the compiler to search its current working directory. Empty elements can show up at the beginning or end of a path. For example, if the value of CPATH is ":/special/include", that has the same effect as -I. -I/special/include. ๐
๐ฌ DEPENDENCIES_OUTPUT
If this variable is set, its value says how to output dependencies for Make, based on the non-system header files the compiler processes. System header files get ignored in the dependency output. ๐
The value can be just a file name, in which case the Make rules get written to that file, and the target name gets guessed from the source file name. Or the value can take the form file target, in which case the rules get written to file using target as the target name. โจ
In other words, this variable is equivalent to combining the options -MM and -MF, with an optional -MT switch too. ๐
๐ท SUNPRO_DEPENDENCIES
This one is the same as 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 variable is set, its value specifies a UNIX timestamp to be used instead of the current date and time in the __DATE__ and __TIME__ macros. That way the embedded timestamps stay reproducible. ๐๐
The value of SOURCE_DATE_EPOCH must be a UNIX timestamp, which is defined as the number of seconds (excluding leap seconds) since 01 Jan 1970 00:00:00, represented 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. ๐ซถ
โจ SEE ALSO โจ
okay bestie, this is your reading list ๐๐ซถ go check out gpl(7), gfdl(7), and fsf-funding(7), then gcc(1). And don't forget the Info entries for cpp AND gcc, they're lowkey the best-written docs out there ๐คโจ
๐ COPYRIGHT ๐
Copyright (c) 1987-2025 Free Software Foundation, Inc. ๐
okay so the whole document is free to copy, distribute, and/or modify under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation ๐ฆ the full license is included in gfdl(7), so go read that if you wanna know the fine print ๐. This manual has no Invariant Sections (no cap, nothing is locked down ๐
โโ๏ธ).
The Front-Cover Text is:
A GNU Manual
The 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.
It's literally giving freedom ๐๐ and the copies people buy help fund GNU development, so you're basically supporting the squad every time you grab one ๐ซถโจ
Okay bestie, that's the whole page, you made it to the end ๐ฅน๐ this was a gcc-15 page, dated 2025-09-17, and it's the CPP(1) manual. Slay the preprocessor and go do something iconic ๐๐
๐ฆ where this page comes from
- ubuntu questing: cpp-15-x86-64-linux-gnu 15.2.0-4ubuntu4
- ubuntu questing: cpp-x86-64-linux-gnu 4:15.2.0-4ubuntu1
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms