annotate gcc/doc/cppopts.texi @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1 @c Copyright (C) 1999-2020 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 @c This is part of the CPP and GCC manuals.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 @c For copying conditions, see the file gcc.texi.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 @c ---------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 @c Options affecting the preprocessor
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 @c ---------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 @c If this file is included with the flag ``cppmanual'' set, it is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 @c formatted for inclusion in the CPP manual; otherwise the main GCC manual.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 @item -D @var{name}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 @opindex D
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 Predefine @var{name} as a macro, with definition @code{1}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 @item -D @var{name}=@var{definition}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 The contents of @var{definition} are tokenized and processed as if
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 they appeared during translation phase three in a @samp{#define}
111
kono
parents: 67
diff changeset
19 directive. In particular, the definition is truncated by
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 embedded newline characters.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 If you are invoking the preprocessor from a shell or shell-like
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 program you may need to use the shell's quoting syntax to protect
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 characters such as spaces that have a meaning in the shell syntax.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 If you wish to define a function-like macro on the command line, write
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 its argument list with surrounding parentheses before the equals sign
111
kono
parents: 67
diff changeset
28 (if any). Parentheses are meaningful to most shells, so you should
kono
parents: 67
diff changeset
29 quote the option. With @command{sh} and @command{csh},
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 @option{-D'@var{name}(@var{args@dots{}})=@var{definition}'} works.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 @option{-D} and @option{-U} options are processed in the order they
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 are given on the command line. All @option{-imacros @var{file}} and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 @option{-include @var{file}} options are processed after all
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 @option{-D} and @option{-U} options.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 @item -U @var{name}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 @opindex U
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 Cancel any previous definition of @var{name}, either built in or
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 provided with a @option{-D} option.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41
111
kono
parents: 67
diff changeset
42 @item -include @var{file}
kono
parents: 67
diff changeset
43 @opindex include
kono
parents: 67
diff changeset
44 Process @var{file} as if @code{#include "file"} appeared as the first
kono
parents: 67
diff changeset
45 line of the primary source file. However, the first directory searched
kono
parents: 67
diff changeset
46 for @var{file} is the preprocessor's working directory @emph{instead of}
kono
parents: 67
diff changeset
47 the directory containing the main source file. If not found there, it
kono
parents: 67
diff changeset
48 is searched for in the remainder of the @code{#include "@dots{}"} search
kono
parents: 67
diff changeset
49 chain as normal.
kono
parents: 67
diff changeset
50
kono
parents: 67
diff changeset
51 If multiple @option{-include} options are given, the files are included
kono
parents: 67
diff changeset
52 in the order they appear on the command line.
kono
parents: 67
diff changeset
53
kono
parents: 67
diff changeset
54 @item -imacros @var{file}
kono
parents: 67
diff changeset
55 @opindex imacros
kono
parents: 67
diff changeset
56 Exactly like @option{-include}, except that any output produced by
kono
parents: 67
diff changeset
57 scanning @var{file} is thrown away. Macros it defines remain defined.
kono
parents: 67
diff changeset
58 This allows you to acquire all the macros from a header without also
kono
parents: 67
diff changeset
59 processing its declarations.
kono
parents: 67
diff changeset
60
kono
parents: 67
diff changeset
61 All files specified by @option{-imacros} are processed before all files
kono
parents: 67
diff changeset
62 specified by @option{-include}.
kono
parents: 67
diff changeset
63
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 @item -undef
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 @opindex undef
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 Do not predefine any system-specific or GCC-specific macros. The
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 standard predefined macros remain defined.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 @ifset cppmanual
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 @xref{Standard Predefined Macros}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 @end ifset
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71
111
kono
parents: 67
diff changeset
72 @item -pthread
kono
parents: 67
diff changeset
73 @opindex pthread
kono
parents: 67
diff changeset
74 Define additional macros required for using the POSIX threads library.
kono
parents: 67
diff changeset
75 You should use this option consistently for both compilation and linking.
kono
parents: 67
diff changeset
76 This option is supported on GNU/Linux targets, most other Unix derivatives,
kono
parents: 67
diff changeset
77 and also on x86 Cygwin and MinGW targets.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 @item -M
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 @opindex M
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
81 @cindex @command{make}
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
82 @cindex dependencies, @command{make}
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 Instead of outputting the result of preprocessing, output a rule
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 suitable for @command{make} describing the dependencies of the main
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 source file. The preprocessor outputs one @command{make} rule containing
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 the object file name for that source file, a colon, and the names of all
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 the included files, including those coming from @option{-include} or
111
kono
parents: 67
diff changeset
88 @option{-imacros} command-line options.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 Unless specified explicitly (with @option{-MT} or @option{-MQ}), the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 object file name consists of the name of the source file with any
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 suffix replaced with object file suffix and with any leading directory
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 parts removed. If there are many included files then the rule is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 split into several lines using @samp{\}-newline. The rule has no
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 commands.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 This option does not suppress the preprocessor's debug output, such as
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 @option{-dM}. To avoid mixing such debug output with the dependency
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 rules you should explicitly specify the dependency output file with
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 @option{-MF}, or use an environment variable like
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 @env{DEPENDENCIES_OUTPUT} (@pxref{Environment Variables}). Debug output
111
kono
parents: 67
diff changeset
102 is still sent to the regular output stream as normal.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 Passing @option{-M} to the driver implies @option{-E}, and suppresses
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 warnings with an implicit @option{-w}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 @item -MM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 @opindex MM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 Like @option{-M} but do not mention header files that are found in
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 system header directories, nor header files that are included,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 directly or indirectly, from such a header.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 This implies that the choice of angle brackets or double quotes in an
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 @samp{#include} directive does not in itself determine whether that
111
kono
parents: 67
diff changeset
115 header appears in @option{-MM} dependency output.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 @anchor{dashMF}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 @item -MF @var{file}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 @opindex MF
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 When used with @option{-M} or @option{-MM}, specifies a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 file to write the dependencies to. If no @option{-MF} switch is given
111
kono
parents: 67
diff changeset
122 the preprocessor sends the rules to the same place it would send
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 preprocessed output.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 When used with the driver options @option{-MD} or @option{-MMD},
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 @option{-MF} overrides the default dependency output file.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127
111
kono
parents: 67
diff changeset
128 If @var{file} is @file{-}, then the dependencies are written to @file{stdout}.
kono
parents: 67
diff changeset
129
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 @item -MG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 @opindex MG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 In conjunction with an option such as @option{-M} requesting
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 dependency generation, @option{-MG} assumes missing header files are
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 generated files and adds them to the dependency list without raising
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 an error. The dependency filename is taken directly from the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 @code{#include} directive without prepending any path. @option{-MG}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 also suppresses preprocessed output, as a missing header file renders
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 this useless.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
139
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 This feature is used in automatic updating of makefiles.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
141
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 @item -MP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 @opindex MP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 This option instructs CPP to add a phony target for each dependency
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 other than the main file, causing each to depend on nothing. These
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 dummy rules work around errors @command{make} gives if you remove header
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 files without updating the @file{Makefile} to match.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
148
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 This is typical output:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
150
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 @smallexample
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 test.o: test.c test.h
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
153
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 test.h:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155 @end smallexample
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
156
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
157 @item -MT @var{target}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
158 @opindex MT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
159
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 Change the target of the rule emitted by dependency generation. By
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 default CPP takes the name of the main input file, deletes any
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
162 directory components and any file suffix such as @samp{.c}, and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 appends the platform's usual object suffix. The result is the target.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
164
111
kono
parents: 67
diff changeset
165 An @option{-MT} option sets the target to be exactly the string you
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 specify. If you want multiple targets, you can specify them as a single
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 argument to @option{-MT}, or use multiple @option{-MT} options.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
168
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
169 For example, @option{@w{-MT '$(objpfx)foo.o'}} might give
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
170
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 @smallexample
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 $(objpfx)foo.o: foo.c
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 @end smallexample
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
174
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 @item -MQ @var{target}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
176 @opindex MQ
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
177
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 Same as @option{-MT}, but it quotes any characters which are special to
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
179 Make. @option{@w{-MQ '$(objpfx)foo.o'}} gives
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
180
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
181 @smallexample
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
182 $$(objpfx)foo.o: foo.c
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 @end smallexample
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
184
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 The default target is automatically quoted, as if it were given with
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 @option{-MQ}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
187
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
188 @item -MD
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 @opindex MD
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 @option{-MD} is equivalent to @option{-M -MF @var{file}}, except that
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 @option{-E} is not implied. The driver determines @var{file} based on
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 whether an @option{-o} option is given. If it is, the driver uses its
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
193 argument but with a suffix of @file{.d}, otherwise it takes the name
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 of the input file, removes any directory components and suffix, and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 applies a @file{.d} suffix.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
196
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 If @option{-MD} is used in conjunction with @option{-E}, any
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
198 @option{-o} switch is understood to specify the dependency output file
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
199 (@pxref{dashMF,,-MF}), but if used without @option{-E}, each @option{-o}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 is understood to specify a target object file.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
201
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 Since @option{-E} is not implied, @option{-MD} can be used to generate
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
203 a dependency output file as a side effect of the compilation process.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
204
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
205 @item -MMD
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 @opindex MMD
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
207 Like @option{-MD} except mention only user header files, not system
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 header files.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209
111
kono
parents: 67
diff changeset
210 @item -fpreprocessed
kono
parents: 67
diff changeset
211 @opindex fpreprocessed
kono
parents: 67
diff changeset
212 Indicate to the preprocessor that the input file has already been
kono
parents: 67
diff changeset
213 preprocessed. This suppresses things like macro expansion, trigraph
kono
parents: 67
diff changeset
214 conversion, escaped newline splicing, and processing of most directives.
kono
parents: 67
diff changeset
215 The preprocessor still recognizes and removes comments, so that you can
kono
parents: 67
diff changeset
216 pass a file preprocessed with @option{-C} to the compiler without
kono
parents: 67
diff changeset
217 problems. In this mode the integrated preprocessor is little more than
kono
parents: 67
diff changeset
218 a tokenizer for the front ends.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
219
111
kono
parents: 67
diff changeset
220 @option{-fpreprocessed} is implicit if the input file has one of the
kono
parents: 67
diff changeset
221 extensions @samp{.i}, @samp{.ii} or @samp{.mi}. These are the
kono
parents: 67
diff changeset
222 extensions that GCC uses for preprocessed files created by
kono
parents: 67
diff changeset
223 @option{-save-temps}.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 @item -fdirectives-only
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 @opindex fdirectives-only
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 When preprocessing, handle directives, but do not expand macros.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
228
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 The option's behavior depends on the @option{-E} and @option{-fpreprocessed}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 options.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
231
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 With @option{-E}, preprocessing is limited to the handling of directives
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 such as @code{#define}, @code{#ifdef}, and @code{#error}. Other
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 preprocessor operations, such as macro expansion and trigraph
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 conversion are not performed. In addition, the @option{-dD} option is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236 implicitly enabled.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
237
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 With @option{-fpreprocessed}, predefinition of command line and most
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 builtin macros is disabled. Macros such as @code{__LINE__}, which are
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 contextually dependent, are handled normally. This enables compilation of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 files previously preprocessed with @code{-E -fdirectives-only}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243 With both @option{-E} and @option{-fpreprocessed}, the rules for
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
244 @option{-fpreprocessed} take precedence. This enables full preprocessing of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 files previously preprocessed with @code{-E -fdirectives-only}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
246
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
247 @item -fdollars-in-identifiers
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
248 @opindex fdollars-in-identifiers
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249 @anchor{fdollars-in-identifiers}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
250 Accept @samp{$} in identifiers.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251 @ifset cppmanual
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 @xref{Identifier characters}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
253 @end ifset
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255 @item -fextended-identifiers
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 @opindex fextended-identifiers
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
257 Accept universal character names and extended characters in
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
258 identifiers. This option is enabled by default for C99 (and later C
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
259 standard versions) and C++.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260
111
kono
parents: 67
diff changeset
261 @item -fno-canonical-system-headers
kono
parents: 67
diff changeset
262 @opindex fno-canonical-system-headers
kono
parents: 67
diff changeset
263 When preprocessing, do not shorten system header paths with canonicalization.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
265 @item -fmax-include-depth=@var{depth}
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
266 @opindex fmax-include-depth
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
267 Set the maximum depth of the nested #include. The default is 200.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
268
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 @item -ftabstop=@var{width}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 @opindex ftabstop
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271 Set the distance between tab stops. This helps the preprocessor report
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 correct column numbers in warnings or errors, even if tabs appear on the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 line. If the value is less than 1 or greater than 100, the option is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 ignored. The default is 8.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275
111
kono
parents: 67
diff changeset
276 @item -ftrack-macro-expansion@r{[}=@var{level}@r{]}
kono
parents: 67
diff changeset
277 @opindex ftrack-macro-expansion
kono
parents: 67
diff changeset
278 Track locations of tokens across macro expansions. This allows the
kono
parents: 67
diff changeset
279 compiler to emit diagnostic about the current macro expansion stack
kono
parents: 67
diff changeset
280 when a compilation error occurs in a macro expansion. Using this
kono
parents: 67
diff changeset
281 option makes the preprocessor and the compiler consume more
kono
parents: 67
diff changeset
282 memory. The @var{level} parameter can be used to choose the level of
kono
parents: 67
diff changeset
283 precision of token location tracking thus decreasing the memory
kono
parents: 67
diff changeset
284 consumption if necessary. Value @samp{0} of @var{level} de-activates
kono
parents: 67
diff changeset
285 this option. Value @samp{1} tracks tokens locations in a
kono
parents: 67
diff changeset
286 degraded mode for the sake of minimal memory overhead. In this mode
kono
parents: 67
diff changeset
287 all tokens resulting from the expansion of an argument of a
kono
parents: 67
diff changeset
288 function-like macro have the same location. Value @samp{2} tracks
kono
parents: 67
diff changeset
289 tokens locations completely. This value is the most memory hungry.
kono
parents: 67
diff changeset
290 When this option is given no argument, the default parameter value is
kono
parents: 67
diff changeset
291 @samp{2}.
kono
parents: 67
diff changeset
292
kono
parents: 67
diff changeset
293 Note that @code{-ftrack-macro-expansion=2} is activated by default.
kono
parents: 67
diff changeset
294
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
295 @item -fmacro-prefix-map=@var{old}=@var{new}
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
296 @opindex fmacro-prefix-map
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
297 When preprocessing files residing in directory @file{@var{old}},
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
298 expand the @code{__FILE__} and @code{__BASE_FILE__} macros as if the
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
299 files resided in directory @file{@var{new}} instead. This can be used
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
300 to change an absolute path to a relative path by using @file{.} for
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
301 @var{new} which can result in more reproducible builds that are
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
302 location independent. This option also affects
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
303 @code{__builtin_FILE()} during compilation. See also
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
304 @option{-ffile-prefix-map}.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
305
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
306 @item -fexec-charset=@var{charset}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
307 @opindex fexec-charset
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
308 @cindex character set, execution
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 Set the execution character set, used for string and character
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 constants. The default is UTF-8. @var{charset} can be any encoding
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 supported by the system's @code{iconv} library routine.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313 @item -fwide-exec-charset=@var{charset}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
314 @opindex fwide-exec-charset
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
315 @cindex character set, wide execution
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
316 Set the wide execution character set, used for wide string and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
317 character constants. The default is UTF-32 or UTF-16, whichever
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 corresponds to the width of @code{wchar_t}. As with
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 @option{-fexec-charset}, @var{charset} can be any encoding supported
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320 by the system's @code{iconv} library routine; however, you will have
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321 problems with encodings that do not fit exactly in @code{wchar_t}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
322
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
323 @item -finput-charset=@var{charset}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
324 @opindex finput-charset
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
325 @cindex character set, input
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
326 Set the input character set, used for translation from the character
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
327 set of the input file to the source character set used by GCC@. If the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
328 locale does not specify, or GCC cannot get this information from the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
329 locale, the default is UTF-8. This can be overridden by either the locale
111
kono
parents: 67
diff changeset
330 or this command-line option. Currently the command-line option takes
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
331 precedence if there's a conflict. @var{charset} can be any encoding
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
332 supported by the system's @code{iconv} library routine.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333
111
kono
parents: 67
diff changeset
334 @ifclear cppmanual
kono
parents: 67
diff changeset
335 @item -fpch-deps
kono
parents: 67
diff changeset
336 @opindex fpch-deps
kono
parents: 67
diff changeset
337 When using precompiled headers (@pxref{Precompiled Headers}), this flag
kono
parents: 67
diff changeset
338 causes the dependency-output flags to also list the files from the
kono
parents: 67
diff changeset
339 precompiled header's dependencies. If not specified, only the
kono
parents: 67
diff changeset
340 precompiled header are listed and not the files that were used to
kono
parents: 67
diff changeset
341 create it, because those files are not consulted when a precompiled
kono
parents: 67
diff changeset
342 header is used.
kono
parents: 67
diff changeset
343
kono
parents: 67
diff changeset
344 @item -fpch-preprocess
kono
parents: 67
diff changeset
345 @opindex fpch-preprocess
kono
parents: 67
diff changeset
346 This option allows use of a precompiled header (@pxref{Precompiled
kono
parents: 67
diff changeset
347 Headers}) together with @option{-E}. It inserts a special @code{#pragma},
kono
parents: 67
diff changeset
348 @code{#pragma GCC pch_preprocess "@var{filename}"} in the output to mark
kono
parents: 67
diff changeset
349 the place where the precompiled header was found, and its @var{filename}.
kono
parents: 67
diff changeset
350 When @option{-fpreprocessed} is in use, GCC recognizes this @code{#pragma}
kono
parents: 67
diff changeset
351 and loads the PCH@.
kono
parents: 67
diff changeset
352
kono
parents: 67
diff changeset
353 This option is off by default, because the resulting preprocessed output
kono
parents: 67
diff changeset
354 is only really suitable as input to GCC@. It is switched on by
kono
parents: 67
diff changeset
355 @option{-save-temps}.
kono
parents: 67
diff changeset
356
kono
parents: 67
diff changeset
357 You should not write this @code{#pragma} in your own code, but it is
kono
parents: 67
diff changeset
358 safe to edit the filename if the PCH file is available in a different
kono
parents: 67
diff changeset
359 location. The filename may be absolute or it may be relative to GCC's
kono
parents: 67
diff changeset
360 current directory.
kono
parents: 67
diff changeset
361 @end ifclear
kono
parents: 67
diff changeset
362
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 @item -fworking-directory
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
364 @opindex fworking-directory
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 @opindex fno-working-directory
111
kono
parents: 67
diff changeset
366 Enable generation of linemarkers in the preprocessor output that
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 let the compiler know the current working directory at the time of
111
kono
parents: 67
diff changeset
368 preprocessing. When this option is enabled, the preprocessor
kono
parents: 67
diff changeset
369 emits, after the initial linemarker, a second linemarker with the
kono
parents: 67
diff changeset
370 current working directory followed by two slashes. GCC uses this
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 directory, when it's present in the preprocessed input, as the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
372 directory emitted as the current working directory in some debugging
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 information formats. This option is implicitly enabled if debugging
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
374 information is enabled, but this can be inhibited with the negated
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
375 form @option{-fno-working-directory}. If the @option{-P} flag is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
376 present in the command line, this option has no effect, since no
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
377 @code{#line} directives are emitted whatsoever.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
378
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
379 @item -A @var{predicate}=@var{answer}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
380 @opindex A
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
381 Make an assertion with the predicate @var{predicate} and answer
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
382 @var{answer}. This form is preferred to the older form @option{-A
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
383 @var{predicate}(@var{answer})}, which is still supported, because
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
384 it does not use shell special characters.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
385 @ifset cppmanual
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
386 @xref{Obsolete Features}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
387 @end ifset
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
388
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
389 @item -A -@var{predicate}=@var{answer}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
390 Cancel an assertion with the predicate @var{predicate} and answer
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
391 @var{answer}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
392
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
393 @item -C
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 @opindex C
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 Do not discard comments. All comments are passed through to the output
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
396 file, except for comments in processed directives, which are deleted
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
397 along with the directive.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
398
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
399 You should be prepared for side effects when using @option{-C}; it
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
400 causes the preprocessor to treat comments as tokens in their own right.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
401 For example, comments appearing at the start of what would be a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
402 directive line have the effect of turning that line into an ordinary
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
403 source line, since the first token on the line is no longer a @samp{#}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
404
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
405 @item -CC
111
kono
parents: 67
diff changeset
406 @opindex CC
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
407 Do not discard comments, including during macro expansion. This is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
408 like @option{-C}, except that comments contained within macros are
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
409 also passed through to the output file where the macro is expanded.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
410
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
411 In addition to the side effects of the @option{-C} option, the
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
412 @option{-CC} option causes all C++-style comments inside a macro
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
413 to be converted to C-style comments. This is to prevent later use
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
414 of that macro from inadvertently commenting out the remainder of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
415 the source line.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
416
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
417 The @option{-CC} option is generally used to support lint comments.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
418
111
kono
parents: 67
diff changeset
419 @item -P
kono
parents: 67
diff changeset
420 @opindex P
kono
parents: 67
diff changeset
421 Inhibit generation of linemarkers in the output from the preprocessor.
kono
parents: 67
diff changeset
422 This might be useful when running the preprocessor on something that is
kono
parents: 67
diff changeset
423 not C code, and will be sent to a program which might be confused by the
kono
parents: 67
diff changeset
424 linemarkers.
kono
parents: 67
diff changeset
425 @ifset cppmanual
kono
parents: 67
diff changeset
426 @xref{Preprocessor Output}.
kono
parents: 67
diff changeset
427 @end ifset
kono
parents: 67
diff changeset
428
kono
parents: 67
diff changeset
429 @cindex traditional C language
kono
parents: 67
diff changeset
430 @cindex C language, traditional
kono
parents: 67
diff changeset
431 @item -traditional
kono
parents: 67
diff changeset
432 @itemx -traditional-cpp
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
433 @opindex traditional-cpp
111
kono
parents: 67
diff changeset
434 @opindex traditional
kono
parents: 67
diff changeset
435
kono
parents: 67
diff changeset
436 Try to imitate the behavior of pre-standard C preprocessors, as
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
437 opposed to ISO C preprocessors.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
438 @ifset cppmanual
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
439 @xref{Traditional Mode}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
440 @end ifset
111
kono
parents: 67
diff changeset
441 @ifclear cppmanual
kono
parents: 67
diff changeset
442 See the GNU CPP manual for details.
kono
parents: 67
diff changeset
443 @end ifclear
kono
parents: 67
diff changeset
444
kono
parents: 67
diff changeset
445 Note that GCC does not otherwise attempt to emulate a pre-standard
kono
parents: 67
diff changeset
446 C compiler, and these options are only supported with the @option{-E}
kono
parents: 67
diff changeset
447 switch, or when invoking CPP explicitly.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
448
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 @item -trigraphs
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
450 @opindex trigraphs
111
kono
parents: 67
diff changeset
451 Support ISO C trigraphs.
kono
parents: 67
diff changeset
452 These are three-character sequences, all starting with @samp{??}, that
kono
parents: 67
diff changeset
453 are defined by ISO C to stand for single characters. For example,
kono
parents: 67
diff changeset
454 @samp{??/} stands for @samp{\}, so @samp{'??/n'} is a character
kono
parents: 67
diff changeset
455 constant for a newline.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
456 @ifset cppmanual
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
457 @xref{Initial processing}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
458 @end ifset
111
kono
parents: 67
diff changeset
459
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
460 @ifclear cppmanual
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461 The nine trigraphs and their replacements are
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
462
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
463 @smallexample
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
464 Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??-
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
465 Replacement: [ ] @{ @} # \ ^ | ~
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 @end smallexample
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 @end ifclear
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
468
111
kono
parents: 67
diff changeset
469 By default, GCC ignores trigraphs, but in
kono
parents: 67
diff changeset
470 standard-conforming modes it converts them. See the @option{-std} and
kono
parents: 67
diff changeset
471 @option{-ansi} options.
kono
parents: 67
diff changeset
472
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
473 @item -remap
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
474 @opindex remap
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
475 Enable special code to work around file systems which only permit very
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
476 short file names, such as MS-DOS@.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
477
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
478 @item -H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
479 @opindex H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
480 Print the name of each header file used, in addition to other normal
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
481 activities. Each name is indented to show how deep in the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
482 @samp{#include} stack it is. Precompiled header files are also
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 printed, even if they are found to be invalid; an invalid precompiled
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
484 header file is printed with @samp{...x} and a valid one with @samp{...!} .
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
485
111
kono
parents: 67
diff changeset
486 @item -d@var{letters}
kono
parents: 67
diff changeset
487 @opindex d
kono
parents: 67
diff changeset
488 Says to make debugging dumps during compilation as specified by
kono
parents: 67
diff changeset
489 @var{letters}. The flags documented here are those relevant to the
kono
parents: 67
diff changeset
490 preprocessor. Other @var{letters} are interpreted
kono
parents: 67
diff changeset
491 by the compiler proper, or reserved for future versions of GCC, and so
kono
parents: 67
diff changeset
492 are silently ignored. If you specify @var{letters} whose behavior
kono
parents: 67
diff changeset
493 conflicts, the result is undefined.
kono
parents: 67
diff changeset
494 @ifclear cppmanual
kono
parents: 67
diff changeset
495 @xref{Developer Options}, for more information.
kono
parents: 67
diff changeset
496 @end ifclear
kono
parents: 67
diff changeset
497
kono
parents: 67
diff changeset
498 @table @gcctabopt
kono
parents: 67
diff changeset
499 @item -dM
kono
parents: 67
diff changeset
500 @opindex dM
kono
parents: 67
diff changeset
501 Instead of the normal output, generate a list of @samp{#define}
kono
parents: 67
diff changeset
502 directives for all the macros defined during the execution of the
kono
parents: 67
diff changeset
503 preprocessor, including predefined macros. This gives you a way of
kono
parents: 67
diff changeset
504 finding out what is predefined in your version of the preprocessor.
kono
parents: 67
diff changeset
505 Assuming you have no file @file{foo.h}, the command
kono
parents: 67
diff changeset
506
kono
parents: 67
diff changeset
507 @smallexample
kono
parents: 67
diff changeset
508 touch foo.h; cpp -dM foo.h
kono
parents: 67
diff changeset
509 @end smallexample
kono
parents: 67
diff changeset
510
kono
parents: 67
diff changeset
511 @noindent
kono
parents: 67
diff changeset
512 shows all the predefined macros.
kono
parents: 67
diff changeset
513
kono
parents: 67
diff changeset
514 @ifclear cppmanual
kono
parents: 67
diff changeset
515 If you use @option{-dM} without the @option{-E} option, @option{-dM} is
kono
parents: 67
diff changeset
516 interpreted as a synonym for @option{-fdump-rtl-mach}.
kono
parents: 67
diff changeset
517 @xref{Developer Options, , ,gcc}.
kono
parents: 67
diff changeset
518 @end ifclear
kono
parents: 67
diff changeset
519
kono
parents: 67
diff changeset
520 @item -dD
kono
parents: 67
diff changeset
521 @opindex dD
kono
parents: 67
diff changeset
522 Like @option{-dM} except in two respects: it does @emph{not} include the
kono
parents: 67
diff changeset
523 predefined macros, and it outputs @emph{both} the @samp{#define}
kono
parents: 67
diff changeset
524 directives and the result of preprocessing. Both kinds of output go to
kono
parents: 67
diff changeset
525 the standard output file.
kono
parents: 67
diff changeset
526
kono
parents: 67
diff changeset
527 @item -dN
kono
parents: 67
diff changeset
528 @opindex dN
kono
parents: 67
diff changeset
529 Like @option{-dD}, but emit only the macro names, not their expansions.
kono
parents: 67
diff changeset
530
kono
parents: 67
diff changeset
531 @item -dI
kono
parents: 67
diff changeset
532 @opindex dI
kono
parents: 67
diff changeset
533 Output @samp{#include} directives in addition to the result of
kono
parents: 67
diff changeset
534 preprocessing.
kono
parents: 67
diff changeset
535
kono
parents: 67
diff changeset
536 @item -dU
kono
parents: 67
diff changeset
537 @opindex dU
kono
parents: 67
diff changeset
538 Like @option{-dD} except that only macros that are expanded, or whose
kono
parents: 67
diff changeset
539 definedness is tested in preprocessor directives, are output; the
kono
parents: 67
diff changeset
540 output is delayed until the use or test of the macro; and
kono
parents: 67
diff changeset
541 @samp{#undef} directives are also output for macros tested but
kono
parents: 67
diff changeset
542 undefined at the time.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
543 @end table
111
kono
parents: 67
diff changeset
544
kono
parents: 67
diff changeset
545 @item -fdebug-cpp
kono
parents: 67
diff changeset
546 @opindex fdebug-cpp
kono
parents: 67
diff changeset
547 This option is only useful for debugging GCC. When used from CPP or with
kono
parents: 67
diff changeset
548 @option{-E}, it dumps debugging information about location maps. Every
kono
parents: 67
diff changeset
549 token in the output is preceded by the dump of the map its location
kono
parents: 67
diff changeset
550 belongs to.
kono
parents: 67
diff changeset
551
kono
parents: 67
diff changeset
552 When used from GCC without @option{-E}, this option has no effect.