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 Ar warn
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.
94 .It Fl W Ns Oo Cm no- Oc Ns Ar warn
96 Disable/enable a specific warning.
97 Every warning option has a corresponding
99 switch to deactivate it.
101 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.
102 .It Fl Waggregate-return
103 Warn about defining or calling a function, which returns a struct or union by value.
105 Activate most warnings.
106 In particular these are
109 .Fl Wchar-subscripts ,
111 .Fl Wempty-statement ,
113 .Fl Wimplicit-function-declaration ,
120 .Fl Wredundant-decls ,
124 .Fl Wstrict-prototypes ,
126 .Fl Wunknown-pragmas ,
127 .Fl Wunreachable-code ,
128 .Fl Wunused-function ,
130 .Fl Wunused-parameter ,
132 .Fl Wunused-variable .
134 Warn whenever a pointer cast removes qualifiers from the pointed-to type, e.g. casting a const char* to char*.
135 .It Fl Wchar-subscripts
136 Warn about using an expression of type char as array subscript, e.g. char\ c; arr[c].
137 .It Fl Wdeclaration-after-statement
138 Warn about mixing declarations and statements, which is not allowed prior to C99.
140 Warn about compile-time integer division by zero.
141 .It Fl Wempty-statement
142 Warn about empty statements, i.e. statements which only consist of a single ';'.
143 Use {} as replacement to avoid this warning.
145 Treat warnings as errors, i.e. do not continue after parsing when a warning is encountered.
146 .It Fl Werror-implicit-function-declaration
147 Generate an error, when calling a function without a prior declaration.
149 Activate some more warnings.
150 In particular these are
151 .Fl Wempty-statement ,
152 .Fl Wunused-parameter ,
155 Immediately abort compilation when encountering an error.
157 Check format strings of char and wchar_t functions.
160 .Fl Wimplicit-function-declaration ,
162 .It Fl Wimplicit-function-declaration
163 Warn about calling a function without a prior declaration.
165 Warn about declarations whose declaration specifiers do not include a type specifier.
167 Warn about uninitialized variables which are initialized with themselves.
169 Warn if the type 'long long' is used.
171 Warn if the type of 'main' 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**).
172 .It Fl Wmissing-declarations
173 Warn if a non-static function or a global variable without a storage class is defined without a prior declaration.
174 This is typically a sign of a missing #include or that the object should be static.
175 .It Fl Wmissing-noreturn
176 Warn about functions, which are candidates for the attribute 'noreturn'.
177 .It Fl Wmissing-prototypes
178 Warn if a global function is defined without a previous prototype declaration.
180 Warn if a multicharacter constant ('FOOF') is used.
181 .It Fl Wnested-externs
182 Warn if an 'extern' declaration is encountered within a function.
184 Warn if parentheses are omitted in certain contexts.
185 Warn if an assignment is used as condition, e.g. if\ (x\ =\ 23).
186 Warn if && without parentheses is used within ||, e.g. if\ (x\ ||\ y\ &&\ z).
187 Warn if it there may be confusion which 'if'-statement an 'else'-branch belongs to, e.g. if\ (x)\ if\ (y)\ {}\ else\ {}.
188 Warn if cascaded comparisons appear which do not have their mathematical meaning, e.g. if\ (23\ <=\ x\ <\ 42).
189 Warn if + or - is used as operand of << or >>, e.g. x\ +\ y\ <<\ z.
190 .It Fl Wredundant-decls
191 Warn about redundant declarations, i.e. multiple declarations of the same object or static forward declarations which have no use before their definition.
192 .It Fl Wunreachable-code
193 Warn when the compiler determines that a statement (or in some cases a part thereof) will never be executed.
196 .Fl Wunused-function ,
198 .Fl Wunused-parameter ,
200 .Fl Wunused-variable .
201 .It Fl Wunused-parameter
202 Warn when a parameter is never used or only ever read to calculate its own new value, e.g. x\ =\ x\ +\ 1.
203 .It Fl Wunused-variable
204 Warn when a variable is never used or only ever read to calculate its own new value, e.g. x\ =\ x\ +\ 1.
206 Suppress all warnings.
210 to the paths to be searched for include files.
214 to the paths to be searched for libraries.
216 Define the preprocessor macro
218 which will expand to 1.
219 .It Fl D Ns Ar macro=defn
220 Define the preprocessor macro
222 and set its expanded value to
225 Undefine the preprocessor macro
228 Set a frontend or optimizer option.
231 to get a list of supported optimizer options.
232 .It Fl finput-charset= Ns Ar encoding
233 Select the encoding of the input.
259 Set a backend option.
262 to get a list of supported options.
264 Link with the specified library.
266 Specify the output filename.
267 This is only valid when using a single input filename.
269 as filename uses stdout for output.
271 Overwrite the language auto-detection for the following filenames by the
274 Supported values are:
275 .Bl -tag -compact -width "assembler-with-cpp"
278 .It Cm assembler-with-cpp
279 Assembler file, which needs to be preprocessed
287 Revert to auto-detection
289 .It Fl Wl, Ns Ar option
293 .It Fl Wp, Ns Ar option
300 http://www.libfirm.org/
302 Probably many - if you hit one, please report it.
305 needs to support more switches for better GCC compatibility.
307 This manual page is incomplete.
313 .Aq matze@braunis.de ,
315 .Aq christoph.mallon@gmx.de