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 C11 with GCC extensions
86 ISO C++ 1998 with GCC extensions.
89 .It Fl - Ns Oo Cm no- Oc Ns Cm gcc
90 Disable/enable GCC extensions.
91 This switch supersedes
93 .It Fl - Ns Oo Cm no- Oc Ns Cm ms
94 Disable/enable MSC extensions.
96 When compiling C files, add debug information in
101 Select the optimization level.
102 Sensible values are between 0 and 4, inclusive.
104 .It Fl W Ns Ar warning
105 Enable the specified warning.
106 .It Fl Wno- Ns Ar warning
107 Disable the specified warning.
108 .It Fl Werror= Ns Ar warning
109 Enable the specified warning and turn it into an error.
110 .It Fl Wno-error= Ns Ar warning
111 Force the specified warning to only be a warning, even in the presence of
113 This neither enables nor disables the warning itself.
115 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.
116 .It Fl Waggregate-return
117 Warn about defining or calling a function, which returns a struct or union by value.
119 Activate most warnings.
120 In particular these are
123 .Fl Wchar-subscripts ,
125 .Fl Wempty-statement ,
127 .Fl Wimplicit-function-declaration ,
134 .Fl Wredundant-decls ,
138 .Fl Wstrict-prototypes ,
140 .Fl Wunknown-pragmas ,
141 .Fl Wunreachable-code ,
142 .Fl Wunused-function ,
144 .Fl Wunused-parameter ,
146 .Fl Wunused-variable .
148 Warn whenever a pointer cast removes qualifiers from the pointed-to type, e.g. casting a const char* to char*.
149 .It Fl Wchar-subscripts
150 Warn about using an expression of type char as array subscript, e.g. char\ c; arr[c].
151 .It Fl Wdeclaration-after-statement
152 Warn about mixing declarations and statements, which is not allowed prior to C99.
154 Warn about compile-time integer division by zero.
155 .It Fl Wempty-statement
156 Warn about empty statements, i.e. statements which only consist of a single
158 Use {} as replacement to avoid this warning.
160 Treat warnings as errors, i.e. do not continue after parsing when a warning is encountered.
164 Activate some more warnings.
165 In particular these are
166 .Fl Wempty-statement ,
168 .Fl Wunused-parameter ,
171 Immediately abort compilation when encountering an error.
173 Check format strings of char and wchar_t functions.
176 .Fl Wimplicit-function-declaration ,
178 .It Fl Wimplicit-function-declaration
179 Warn about calling a function without a prior declaration.
181 Warn about declarations whose declaration specifiers do not include a type specifier.
183 Warn about uninitialized variables which are initialized with themselves.
191 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**).
192 .It Fl Wmissing-declarations
193 Warn if a non-static function or a global variable without a storage class is defined without a prior declaration.
194 This is typically a sign of a missing #include or that the object should be static.
195 .It Fl Wmissing-noreturn
196 Warn about functions, which are candidates for the attribute
198 .It Fl Wmissing-prototypes
199 Warn if a global function is defined without a previous prototype declaration.
201 Warn if a multicharacter constant
204 .It Fl Wnested-externs
207 declaration is encountered within a function.
209 Warn if parentheses are omitted in certain contexts.
210 Warn if an assignment is used as condition, e.g. if\ (x\ =\ 23).
211 Warn if && without parentheses is used within ||, e.g. if\ (x\ ||\ y\ &&\ z).
212 Warn if it there may be confusion which
216 -branch belongs to, e.g. if\ (x)\ if\ (y)\ {}\ else\ {}.
217 Warn if cascaded comparisons appear which do not have their mathematical meaning, e.g. if\ (23\ <=\ x\ <\ 42).
218 Warn if + or - is used as operand of << or >>, e.g. x\ +\ y\ <<\ z.
219 .It Fl Wredundant-decls
220 Warn about redundant declarations, i.e. multiple declarations of the same object or static forward declarations which have no use before their definition.
222 Warn when a new declaration shadows another declaration with the same name in an outer scope.
226 but only warn if the shadowed declaration is not global, e.g. a local variable shadows a parameter or another local variable.
227 .It Fl Wunreachable-code
228 Warn when the compiler determines that a statement (or in some cases a part thereof) will never be executed.
231 .Fl Wunused-function ,
233 .Fl Wunused-parameter ,
235 .Fl Wunused-variable .
236 .It Fl Wunused-parameter
237 Warn when a parameter is never used or only ever read to calculate its own new value, e.g. x\ =\ x\ +\ 1.
238 .It Fl Wunused-variable
239 Warn when a variable is never used or only ever read to calculate its own new value, e.g. x\ =\ x\ +\ 1.
241 Suppress all warnings.
245 to the paths to be searched for include files.
249 to the paths to be searched for libraries.
251 Define the preprocessor macro
253 which will expand to 1.
254 .It Fl D Ns Ar macro=defn
255 Define the preprocessor macro
257 and set its expanded value to
260 Undefine the preprocessor macro
263 Set a frontend or optimizer option.
266 to get a list of supported optimizer options.
267 .It Fl f Ns Oo Cm no- Oc Ns Cm diagnostics-show-option
268 Show the switch, which controls a warning, after each warning.
270 .It Fl finput-charset= Ns Ar encoding
271 Select the encoding of the input.
300 .It Fl f Ns Oo Cm no- Oc Ns Cm show-column
301 Show the column number in diagnostic messages.
305 to have the same range, representation and behaviour as
307 .It Fl funsigned-char
310 to have the same range, representation and behaviour as
313 Set a backend option.
316 to get a list of supported options.
318 Link with the specified library.
320 Specify the output filename.
321 This is only valid when using a single input filename.
323 as filename uses stdout for output.
325 Overwrite the language auto-detection for the following filenames by the
328 Supported values are:
329 .Bl -tag -compact -width "assembler-with-cpp"
332 .It Cm assembler-with-cpp
333 Assembler file, which needs to be preprocessed
341 Revert to auto-detection
343 .It Fl Wl, Ns Ar option
347 .It Fl Wp, Ns Ar option
354 http://www.libfirm.org/
356 Probably many - if you hit one, please report it.
359 needs to support more switches for better GCC compatibility.
361 This manual page is incomplete.
367 .Aq matze@braunis.de ,
369 .Aq christoph.mallon@gmx.de