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 ,
118 .Fl Wredundant-decls ,
122 .Fl Wstrict-prototypes ,
124 .Fl Wunknown-pragmas ,
125 .Fl Wunreachable-code ,
126 .Fl Wunused-function ,
128 .Fl Wunused-parameter ,
130 .Fl Wunused-variable .
132 Warn whenever a pointer cast removes qualifiers from the pointed-to type, e.g. casting a const char* to char*.
133 .It Fl Wchar-subscripts
134 Warn about using an expression of type char as array subscript, e.g. char c; arr[c].
135 .It Fl Wdeclaration-after-statement
136 Warn about mixing declarations and statements, which is not allowed prior to C99.
138 Warn about compile-time integer division by zero.
139 .It Fl Wempty-statement
140 Warn about empty statements, i.e. statements which only consist of a single ';'.
141 Use {} as replacement to avoid this warning.
143 Treat warnings as errors, i.e. do not continue after parsing when a warning is encountered.
144 .It Fl Werror-implicit-function-declaration
145 Generate an error, when calling a function without a prior declaration.
147 Activate some more warnings.
148 In particular these are
149 .Fl Wempty-statement ,
150 .Fl Wunused-parameter ,
153 Immediately abort compilation when encountering an error.
155 Check format strings of char and wchar_t functions.
158 .Fl Wimplicit-function-declaration ,
160 .It Fl Wimplicit-function-declaration
161 Warn about calling a function without a prior declaration.
163 Warn about declarations whose declaration specifiers do not include a type specifier.
165 Warn about uninitialized variables which are initialized with themselves.
167 Warn if the type 'long long' is used.
169 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**).
170 .It Fl Wmissing-declarations
171 Warn if a non-static function or a global variable without a storage class is defined without a prior declaration.
172 This is typically a sign of a missing #include or that the object should be static.
173 .It Fl Wmissing-noreturn
174 Warn about functions, which are candidates for the attribute 'noreturn'.
175 .It Fl Wmissing-prototypes
176 Warn if a global function is defined without a previous prototype declaration.
178 Warn if a multicharacter constant ('FOOF') is used.
179 .It Fl Wnested-externs
180 Warn if an 'extern' declaration is encountered within a function.
181 .It Fl Wredundant-decls
182 Warn about redundant declarations, i.e. multiple declarations of the same object or static forward declarations which have no use before their definition.
183 .It Fl Wunreachable-code
184 Warn when the compiler determines that a statement (or in some cases a part thereof) will never be executed.
187 .Fl Wunused-function ,
189 .Fl Wunused-parameter ,
191 .Fl Wunused-variable .
192 .It Fl Wunused-parameter
193 Warn when a parameter is never used or only ever read to calculate its own new value, e.g. x = x + 1.
194 .It Fl Wunused-variable
195 Warn when a variable is never used or only ever read to calculate its own new value, e.g. x = x + 1.
197 Suppress all warnings.
201 to the paths to be searched for include files.
205 to the paths to be searched for libraries.
207 Define the preprocessor macro
209 which will expand to 1.
210 .It Fl D Ns Ar macro=defn
211 Define the preprocessor macro
213 and set its expanded value to
216 Undefine the preprocessor macro
219 Set a frontend or optimizer option.
222 to get a list of supported optimizer options.
224 Set a backend option.
227 to get a list of supported options.
229 Link with the specified library.
231 Specify the output filename.
232 This is only valid when using a single input filename.
234 as filename uses stdout for output.
236 Overwrite the language auto-detection for the following filenames by the
239 Supported values are:
240 .Bl -tag -compact -width "assembler-with-cpp"
243 .It Cm assembler-with-cpp
244 Assembler file, which needs to be preprocessed
252 Revert to auto-detection
254 .It Fl Wl, Ns Ar option
258 .It Fl Wp, Ns Ar option
265 http://www.libfirm.org/
267 Probably many - if you hit one, please report it.
270 needs to support more switches for better GCC compatibility.
272 This manual page is incomplete.
278 .Aq matze@braunis.de ,
280 .Aq christoph.mallon@gmx.de