1 .\" Please adjust this date whenever revising the manpage.
9 .Op Fl c | S | E | -print-ast
10 .Op Fl -print-implicit-cast
11 .Op Fl -print-parenthesis
13 .Op Fl std= Ns Ar standard
14 .Op Fl - Ns Oo Cm no- Oc Ns Cm gcc
15 .Op Fl - Ns Oo Cm no- Oc Ns Cm ms
18 .Op Fl W Ns Oo Cm no- Oc Ns Oo Cm error= Oc Ns Ar warning
22 .Op Fl D Ns Ar macro Ns Op Ar =defn
25 .Op Fl finput-charset= Ns Ar encoding
30 .Op Fl Wl, Ns Ar option
31 .Op Fl Wp, Ns Ar option
35 is a C compiler, which can parse C90 and C99 as well as many GCC and some MSC extensions.
36 It also provides many useful analyses for warnings and generates concise messages in case of error.
37 It uses libFIRM for optimization and code generation.
38 The compiler driver is largely compatible with GCC.
42 Compile the input files to object files.
43 The default output filename is the input filename with the extension replaced by .o.
45 Compile the input files to assembler.
46 The default output filename is the input filename with the extension replaced by .s.
48 Preprocess the input file only.
49 By default the result is output to stdout.
51 Output the abstract syntax tree of the parsed input file as C again.
52 .It Fl -print-implicit-cast
55 show casts, which are inserted by the semantic checks.
56 .It Fl -print-parenthesis
59 show all expressions fully parenthesized.
61 Same as -std=c90 (for C) or -std=c++98 (for C++).
62 .It Fl std= Ns Ar standard
63 Select the language standard.
65 .Bl -tag -compact -width "iso9899:1990"
71 ISO C90 with GCC extensions
76 ISO C99 with GCC extensions
81 ISO C++ 1998 with GCC extensions.
84 .It Fl - Ns Oo Cm no- Oc Ns Cm gcc
85 Disable/enable GCC extensions.
86 This switch supersedes
88 .It Fl - Ns Oo Cm no- Oc Ns Cm ms
89 Disable/enable MSC extensions.
91 When compiling C files, add debug information in
96 Select the optimization level.
97 Sensible values are between 0 and 4, inclusive.
99 .It Fl W Ns Ar warning
100 Enable the specified warning.
101 .It Fl Wno- Ns Ar warning
102 Disable the specified warning.
103 .It Fl Werror= Ns Ar warning
104 Enable the specified warning and turn it into an error.
105 .It Fl Wno-error= Ns Ar warning
106 Force the specified warning to only be a warning, even in the presence of
108 This neither enables nor disables the warning itself.
110 Warn about suspicious use of addresses, like using the address of a function or variable as boolean condition or comparing with the address of a string literal.
111 .It Fl Waggregate-return
112 Warn about defining or calling a function, which returns a struct or union by value.
114 Activate most warnings.
115 In particular these are
118 .Fl Wchar-subscripts ,
120 .Fl Wempty-statement ,
122 .Fl Wimplicit-function-declaration ,
129 .Fl Wredundant-decls ,
133 .Fl Wstrict-prototypes ,
135 .Fl Wunknown-pragmas ,
136 .Fl Wunreachable-code ,
137 .Fl Wunused-function ,
139 .Fl Wunused-parameter ,
141 .Fl Wunused-variable .
143 Warn whenever a pointer cast removes qualifiers from the pointed-to type, e.g. casting a const char* to char*.
144 .It Fl Wchar-subscripts
145 Warn about using an expression of type char as array subscript, e.g. char\ c; arr[c].
146 .It Fl Wdeclaration-after-statement
147 Warn about mixing declarations and statements, which is not allowed prior to C99.
149 Warn about compile-time integer division by zero.
150 .It Fl Wempty-statement
151 Warn about empty statements, i.e. statements which only consist of a single
153 Use {} as replacement to avoid this warning.
155 Treat warnings as errors, i.e. do not continue after parsing when a warning is encountered.
159 Activate some more warnings.
160 In particular these are
161 .Fl Wempty-statement ,
163 .Fl Wunused-parameter ,
166 Immediately abort compilation when encountering an error.
168 Check format strings of char and wchar_t functions.
171 .Fl Wimplicit-function-declaration ,
173 .It Fl Wimplicit-function-declaration
174 Warn about calling a function without a prior declaration.
176 Warn about declarations whose declaration specifiers do not include a type specifier.
178 Warn about uninitialized variables which are initialized with themselves.
186 is suspicious, i.e. if it is not a non-static function declared as either int\ main(void), int\ main(int,\ char**) or, as an extension, int\ main(int,\ char**,\ char**).
187 .It Fl Wmissing-declarations
188 Warn if a non-static function or a global variable without a storage class is defined without a prior declaration.
189 This is typically a sign of a missing #include or that the object should be static.
190 .It Fl Wmissing-noreturn
191 Warn about functions, which are candidates for the attribute
193 .It Fl Wmissing-prototypes
194 Warn if a global function is defined without a previous prototype declaration.
196 Warn if a multicharacter constant
199 .It Fl Wnested-externs
202 declaration is encountered within a function.
204 Warn if parentheses are omitted in certain contexts.
205 Warn if an assignment is used as condition, e.g. if\ (x\ =\ 23).
206 Warn if && without parentheses is used within ||, e.g. if\ (x\ ||\ y\ &&\ z).
207 Warn if it there may be confusion which
211 -branch belongs to, e.g. if\ (x)\ if\ (y)\ {}\ else\ {}.
212 Warn if cascaded comparisons appear which do not have their mathematical meaning, e.g. if\ (23\ <=\ x\ <\ 42).
213 Warn if + or - is used as operand of << or >>, e.g. x\ +\ y\ <<\ z.
214 .It Fl Wredundant-decls
215 Warn about redundant declarations, i.e. multiple declarations of the same object or static forward declarations which have no use before their definition.
217 Warn when a new declaration shadows another declaration with the same name in an outer scope.
221 but only warn if the shadowed declaration is not global, e.g. a local variable shadows a parameter or another local variable.
222 .It Fl Wunreachable-code
223 Warn when the compiler determines that a statement (or in some cases a part thereof) will never be executed.
226 .Fl Wunused-function ,
228 .Fl Wunused-parameter ,
230 .Fl Wunused-variable .
231 .It Fl Wunused-parameter
232 Warn when a parameter is never used or only ever read to calculate its own new value, e.g. x\ =\ x\ +\ 1.
233 .It Fl Wunused-variable
234 Warn when a variable is never used or only ever read to calculate its own new value, e.g. x\ =\ x\ +\ 1.
236 Suppress all warnings.
240 to the paths to be searched for include files.
244 to the paths to be searched for libraries.
246 Define the preprocessor macro
248 which will expand to 1.
249 .It Fl D Ns Ar macro=defn
250 Define the preprocessor macro
252 and set its expanded value to
255 Undefine the preprocessor macro
258 Set a frontend or optimizer option.
261 to get a list of supported optimizer options.
262 .It Fl f Ns Oo Cm no- Oc Ns Cm diagnostics-show-option
263 Show the switch, which controls a warning, after each warning.
265 .It Fl finput-charset= Ns Ar encoding
266 Select the encoding of the input.
295 .It Fl f Ns Oo Cm no- Oc Ns Cm show-column
296 Show the column number in diagnostic messages.
300 to have the same range, representation and behaviour as
302 .It Fl funsigned-char
305 to have the same range, representation and behaviour as
308 Set a backend option.
311 to get a list of supported options.
313 Link with the specified library.
315 Specify the output filename.
316 This is only valid when using a single input filename.
318 as filename uses stdout for output.
320 Overwrite the language auto-detection for the following filenames by the
323 Supported values are:
324 .Bl -tag -compact -width "assembler-with-cpp"
327 .It Cm assembler-with-cpp
328 Assembler file, which needs to be preprocessed
336 Revert to auto-detection
338 .It Fl Wl, Ns Ar option
342 .It Fl Wp, Ns Ar option
349 http://www.libfirm.org/
351 Probably many - if you hit one, please report it.
354 needs to support more switches for better GCC compatibility.
356 This manual page is incomplete.
362 .Aq matze@braunis.de ,
364 .Aq christoph.mallon@gmx.de