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
12 .Op Fl std= Ns Ar standard
13 .Op Fl - Ns Oo Cm no- Oc Ns Cm gcc
14 .Op Fl - Ns Oo Cm no- Oc Ns Cm ms
17 .Op Fl W Ns Oo Cm no- Oc Ns Oo Cm error= Oc Ns Ar warning
21 .Op Fl D Ns Ar macro Ns Op Ar =defn
24 .Op Fl finput-charset= Ns Ar encoding
29 .Op Fl Wl, Ns Ar option
30 .Op Fl Wp, Ns Ar option
34 is a C compiler, which can parse C90 and C99 as well as many GCC and some MSC extensions.
35 It also provides many useful analyses for warnings and generates concise messages in case of error.
36 It uses libFIRM for optimization and code generation.
37 The compiler driver is largely compatible with GCC.
41 Compile the input files to object files.
42 The default output filename is the input filename with the extension replaced by .o.
44 Compile the input files to assembler.
45 The default output filename is the input filename with the extension replaced by .s.
47 Preprocess the input file only.
48 By default the result is output to stdout.
50 Output the abstract syntax tree of the parsed input file as C again.
51 .It Fl -print-implicit-cast
54 show casts, which are inserted by the semantic checks.
55 .It Fl -print-parenthesis
58 show all expressions fully parenthesized.
59 .It Fl std= Ns Ar standard
60 Select the language standard.
62 .Bl -tag -compact -width "iso9899:1990"
67 ISO C90 with GCC extensions
72 ISO C99 with GCC extensions
77 ISO C++ 1998 with GCC extensions.
80 .It Fl - Ns Oo Cm no- Oc Ns Cm gcc
81 Disable/enable GCC extensions.
82 This switch supersedes
84 .It Fl - Ns Oo Cm no- Oc Ns Cm ms
85 Disable/enable MSC extensions.
87 When compiling C files, add debug information in
92 Select the optimization level.
93 Sensible values are between 0 and 4, inclusive.
95 .It Fl W Ns Ar warning
96 Enable the specified warning.
97 .It Fl Wno- Ns Ar warning
98 Disable the specified warning.
99 .It Fl Werror= Ns Ar warning
100 Enable the specified warning and turn it into an error.
101 .It Fl Wno-error= Ns Ar warning
102 Force the specified warning to only be a warning, even in the presence of
104 This neither enables nor disables the warning itself.
106 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.
107 .It Fl Waggregate-return
108 Warn about defining or calling a function, which returns a struct or union by value.
110 Activate most warnings.
111 In particular these are
114 .Fl Wchar-subscripts ,
116 .Fl Wempty-statement ,
118 .Fl Wimplicit-function-declaration ,
125 .Fl Wredundant-decls ,
129 .Fl Wstrict-prototypes ,
131 .Fl Wunknown-pragmas ,
132 .Fl Wunreachable-code ,
133 .Fl Wunused-function ,
135 .Fl Wunused-parameter ,
137 .Fl Wunused-variable .
139 Warn whenever a pointer cast removes qualifiers from the pointed-to type, e.g. casting a const char* to char*.
140 .It Fl Wchar-subscripts
141 Warn about using an expression of type char as array subscript, e.g. char\ c; arr[c].
142 .It Fl Wdeclaration-after-statement
143 Warn about mixing declarations and statements, which is not allowed prior to C99.
145 Warn about compile-time integer division by zero.
146 .It Fl Wempty-statement
147 Warn about empty statements, i.e. statements which only consist of a single
149 Use {} as replacement to avoid this warning.
151 Treat warnings as errors, i.e. do not continue after parsing when a warning is encountered.
155 Activate some more warnings.
156 In particular these are
157 .Fl Wempty-statement ,
159 .Fl Wunused-parameter ,
162 Immediately abort compilation when encountering an error.
164 Check format strings of char and wchar_t functions.
167 .Fl Wimplicit-function-declaration ,
169 .It Fl Wimplicit-function-declaration
170 Warn about calling a function without a prior declaration.
172 Warn about declarations whose declaration specifiers do not include a type specifier.
174 Warn about uninitialized variables which are initialized with themselves.
182 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**).
183 .It Fl Wmissing-declarations
184 Warn if a non-static function or a global variable without a storage class is defined without a prior declaration.
185 This is typically a sign of a missing #include or that the object should be static.
186 .It Fl Wmissing-noreturn
187 Warn about functions, which are candidates for the attribute
189 .It Fl Wmissing-prototypes
190 Warn if a global function is defined without a previous prototype declaration.
192 Warn if a multicharacter constant
195 .It Fl Wnested-externs
198 declaration is encountered within a function.
200 Warn if parentheses are omitted in certain contexts.
201 Warn if an assignment is used as condition, e.g. if\ (x\ =\ 23).
202 Warn if && without parentheses is used within ||, e.g. if\ (x\ ||\ y\ &&\ z).
203 Warn if it there may be confusion which
207 -branch belongs to, e.g. if\ (x)\ if\ (y)\ {}\ else\ {}.
208 Warn if cascaded comparisons appear which do not have their mathematical meaning, e.g. if\ (23\ <=\ x\ <\ 42).
209 Warn if + or - is used as operand of << or >>, e.g. x\ +\ y\ <<\ z.
210 .It Fl Wredundant-decls
211 Warn about redundant declarations, i.e. multiple declarations of the same object or static forward declarations which have no use before their definition.
213 Warn when a new declaration shadows another declaration with the same name in an outer scope.
217 but only warn if the shadowed declaration is not global, e.g. a local variable shadows a parameter or another local variable.
218 .It Fl Wunreachable-code
219 Warn when the compiler determines that a statement (or in some cases a part thereof) will never be executed.
222 .Fl Wunused-function ,
224 .Fl Wunused-parameter ,
226 .Fl Wunused-variable .
227 .It Fl Wunused-parameter
228 Warn when a parameter is never used or only ever read to calculate its own new value, e.g. x\ =\ x\ +\ 1.
229 .It Fl Wunused-variable
230 Warn when a variable is never used or only ever read to calculate its own new value, e.g. x\ =\ x\ +\ 1.
232 Suppress all warnings.
236 to the paths to be searched for include files.
240 to the paths to be searched for libraries.
242 Define the preprocessor macro
244 which will expand to 1.
245 .It Fl D Ns Ar macro=defn
246 Define the preprocessor macro
248 and set its expanded value to
251 Undefine the preprocessor macro
254 Set a frontend or optimizer option.
257 to get a list of supported optimizer options.
258 .It Fl f Ns Oo Cm no- Oc Ns Cm diagnostics-show-option
259 Show the switch, which controls a warning, after each warning.
261 .It Fl finput-charset= Ns Ar encoding
262 Select the encoding of the input.
291 .It Fl f Ns Oo Cm no- Oc Ns Cm show-column
292 Show the column number in diagnostic messages.
296 to have the same range, representation and behaviour as
298 .It Fl funsigned-char
301 to have the same range, representation and behaviour as
304 Set a backend option.
307 to get a list of supported options.
309 Link with the specified library.
311 Specify the output filename.
312 This is only valid when using a single input filename.
314 as filename uses stdout for output.
316 Overwrite the language auto-detection for the following filenames by the
319 Supported values are:
320 .Bl -tag -compact -width "assembler-with-cpp"
323 .It Cm assembler-with-cpp
324 Assembler file, which needs to be preprocessed
332 Revert to auto-detection
334 .It Fl Wl, Ns Ar option
338 .It Fl Wp, Ns Ar option
345 http://www.libfirm.org/
347 Probably many - if you hit one, please report it.
350 needs to support more switches for better GCC compatibility.
352 This manual page is incomplete.
358 .Aq matze@braunis.de ,
360 .Aq christoph.mallon@gmx.de