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
28 .Op Fl Wl, Ns Ar option
29 .Op Fl Wp, Ns Ar option
33 is a C compiler, which can parse C90 and C99 as well as many GCC and some MSC extensions.
34 It also provides many useful analyses for warnings and generates concise messages in case of error.
35 It uses libFIRM for optimization and code generation.
36 The compiler driver is largely compatible with GCC.
40 Compile the input files to object files.
41 The default output filename is the input filename with the extension replaced by .o.
43 Compile the input files to assembler.
44 The default output filename is the input filename with the extension replaced by .s.
46 Preprocess the input file only.
47 By default the result is output to stdout.
49 Output the abstract syntax tree of the parsed input file as C again.
50 .It Fl -print-implicit-cast
53 show casts, which are inserted by the semantic checks.
54 .It Fl -print-parenthesis
57 show all expressions fully parenthesized.
58 .It Fl std= Ns Ar standard
59 Select the language standard.
61 .Bl -tag -compact -width "iso9899:1990"
66 ISO C90 with GCC extensions
71 ISO C99 with GCC extensions
76 ISO C++ 1998 with GCC extensions.
79 .It Fl - Ns Oo Cm no- Oc Ns Cm gcc
80 Disable/enable GCC extensions.
81 This switch supersedes
83 .It Fl - Ns Oo Cm no- Oc Ns Cm ms
84 Disable/enable MSC extensions.
86 When compiling C files, add debug information in
91 Select the optimization level.
92 Sensible values are between 0 and 4, inclusive.
93 .It Fl W Ns Oo Cm no- Oc Ns Ar warn
95 Disable/enable a specific warning.
96 Every warning option has a corresponding
98 switch to deactivate it.
100 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.
101 .It Fl Waggregate-return
102 Warn about defining or calling a function, which returns a struct or union by value.
104 Activate most warnings.
105 In particular these are
108 .Fl Wchar-subscripts ,
110 .Fl Wempty-statement ,
112 .Fl Wimplicit-function-declaration ,
119 .Fl Wredundant-decls ,
123 .Fl Wstrict-prototypes ,
125 .Fl Wunknown-pragmas ,
126 .Fl Wunreachable-code ,
127 .Fl Wunused-function ,
129 .Fl Wunused-parameter ,
131 .Fl Wunused-variable .
133 Warn whenever a pointer cast removes qualifiers from the pointed-to type, e.g. casting a const char* to char*.
134 .It Fl Wchar-subscripts
135 Warn about using an expression of type char as array subscript, e.g. char c; arr[c].
136 .It Fl Wdeclaration-after-statement
137 Warn about mixing declarations and statements, which is not allowed prior to C99.
139 Warn about compile-time integer division by zero.
140 .It Fl Wempty-statement
141 Warn about empty statements, i.e. statements which only consist of a single ';'.
142 Use {} as replacement to avoid this warning.
144 Treat warnings as errors, i.e. do not continue after parsing when a warning is encountered.
145 .It Fl Werror-implicit-function-declaration
146 Generate an error, when calling a function without a prior declaration.
148 Activate some more warnings.
149 In particular these are
150 .Fl Wempty-statement ,
151 .Fl Wunused-parameter ,
154 Immediately abort compilation when encountering an error.
156 Check format strings of char and wchar_t functions.
159 .Fl Wimplicit-function-declaration ,
161 .It Fl Wimplicit-function-declaration
162 Warn about calling a function without a prior declaration.
164 Warn about declarations whose declaration specifiers do not include a type specifier.
166 Warn about uninitialized variables which are initialized with themselves.
168 Warn if the type 'long long' is used.
170 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**).
171 .It Fl Wmissing-declarations
172 Warn if a non-static function or a global variable without a storage class is defined without a prior declaration.
173 This is typically a sign of a missing #include or that the object should be static.
174 .It Fl Wmissing-noreturn
175 Warn about functions, which are candidates for the attribute 'noreturn'.
176 .It Fl Wmissing-prototypes
177 Warn if a global function is defined without a previous prototype declaration.
179 Warn if a multicharacter constant ('FOOF') is used.
180 .It Fl Wnested-externs
181 Warn if an 'extern' declaration is encountered within a function.
183 Warn if parentheses are omitted in certain contexts.
184 Warn if an assignment is used as condition, e.g. if\ (x\ =\ 23).
185 Warn if && without parentheses is used within ||, e.g. if\ (x\ ||\ y\ &&\ z).
186 Warn if it there may be confusion which 'if'-statement an 'else'-branch belongs to, e.g. if\ (x)\ if\ (y)\ {}\ else\ {}.
187 Warn if cascaded comparisons appear which do not have their mathematical meaning, e.g. if\ (23\ <=\ x\ <\ 42).
188 .It Fl Wredundant-decls
189 Warn about redundant declarations, i.e. multiple declarations of the same object or static forward declarations which have no use before their definition.
190 .It Fl Wunreachable-code
191 Warn when the compiler determines that a statement (or in some cases a part thereof) will never be executed.
194 .Fl Wunused-function ,
196 .Fl Wunused-parameter ,
198 .Fl Wunused-variable .
199 .It Fl Wunused-parameter
200 Warn when a parameter is never used or only ever read to calculate its own new value, e.g. x\ =\ x\ +\ 1.
201 .It Fl Wunused-variable
202 Warn when a variable is never used or only ever read to calculate its own new value, e.g. x\ =\ x\ +\ 1.
204 Suppress all warnings.
208 to the paths to be searched for include files.
212 to the paths to be searched for libraries.
214 Define the preprocessor macro
216 which will expand to 1.
217 .It Fl D Ns Ar macro=defn
218 Define the preprocessor macro
220 and set its expanded value to
223 Undefine the preprocessor macro
226 Set a frontend or optimizer option.
229 to get a list of supported optimizer options.
231 Set a backend option.
234 to get a list of supported options.
236 Link with the specified library.
238 Specify the output filename.
239 This is only valid when using a single input filename.
241 as filename uses stdout for output.
243 Overwrite the language auto-detection for the following filenames by the
246 Supported values are:
247 .Bl -tag -compact -width "assembler-with-cpp"
250 .It Cm assembler-with-cpp
251 Assembler file, which needs to be preprocessed
259 Revert to auto-detection
261 .It Fl Wl, Ns Ar option
265 .It Fl Wp, Ns Ar option
272 http://www.libfirm.org/
274 Probably many - if you hit one, please report it.
277 needs to support more switches for better GCC compatibility.
279 This manual page is incomplete.
285 .Aq matze@braunis.de ,
287 .Aq christoph.mallon@gmx.de