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
31 is a C compiler, which can parse C90 and C99 as well as many GCC and some MSC extensions.
32 It also provides many useful analyses for warnings and generates concise messages in case of error.
33 It uses libFIRM for optimization and code generation.
34 The compiler driver is largely compatible with GCC.
38 Compile the input files to object files.
39 The default output filename is the input filename with the extension replaced by .o.
41 Compile the input files to assembler.
42 The default output filename is the input filename with the extension replaced by .s.
44 Preprocess the input file only.
45 By default the result is output to stdout.
47 Output the abstract syntax tree of the parsed input file as C again.
48 .It Fl -print-implicit-cast
51 show casts, which are inserted by the semantic checks.
52 .It Fl -print-parenthesis
55 show all expressions fully parenthesized.
56 .It Fl std= Ns Ar standard
57 Select the language standard.
59 .Bl -tag -compact -width "iso9899:1990"
64 ISO C90 with GCC extensions
69 ISO C99 with GCC extensions
74 ISO C++ 1998 with GCC extensions.
77 .It Fl - Ns Oo Cm no- Oc Ns Cm gcc
78 Disable/enable GCC extensions.
79 This switch supersedes
81 .It Fl - Ns Oo Cm no- Oc Ns Cm ms
82 Disable/enable MSC extensions.
84 When compiling C files, add debug information in
89 Select the optimization level.
90 Sensible values are between 0 and 4, inclusive.
91 .It Fl W Ns Oo Cm no- Oc Ns Ar warn
93 Disable/enable a specific warning.
94 Every warning option has a corresponding
96 switch to deactivate it.
98 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.
99 .It Fl Waggregate-return
100 Warn about defining or calling a function, which returns a struct or union by value.
102 Activate most warnings.
103 In particular these are
106 .Fl Wchar-subscripts ,
108 .Fl Wempty-statement ,
110 .Fl Wimplicit-function-declaration ,
116 .Fl Wredundant-decls ,
120 .Fl Wstrict-prototypes ,
122 .Fl Wunknown-pragmas ,
123 .Fl Wunreachable-code ,
124 .Fl Wunused-function ,
126 .Fl Wunused-parameter ,
128 .Fl Wunused-variable .
130 Warn whenever a pointer cast removes qualifiers from the pointed-to type, e.g. casting a const char* to char*.
131 .It Fl char-subscripts
132 Warn about using an expression of type char as array subscript, e.g. char c; arr[c].
133 .It Fl Wdeclaration-after-statement
134 Warn about mixing declarations and statements, which is not allowed prior to C99.
136 Warn about compile-time integer division by zero.
137 .It Fl Wempty-statement
138 Warn about empty statements, i.e. statements which only consist of a single ';'.
139 Use {} as replacement to avoid this warning.
141 Treat warnings as errors, i.e. do not continue after parsing when a warning is encountered.
143 Activate some more warnings.
144 In particular these are
145 .Fl Wempty-statement ,
146 .Fl Wunused-parameter ,
149 Immediately abort compilation when encountering an error.
151 Check format strings of char and wchar_t functions.
154 .Fl Wimplicit-function-declaration ,
156 .It Fl Wimplicit-function-declaration
157 Warn about calling a function without a prior declaration.
159 Warn about declarations whose declaration specifiers do not include a type specifier.
161 Warn about uninitialized variables which are initialized with themselves.
163 Warn if the type 'long long' is used.
165 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**).
166 .It Fl Wmissing-declarations
167 Warn if a non-static function or a global variable without a storage class is defined without a prior declaration.
168 This is typically a sign of a missing #include or that the object should be static.
169 .It Fl Wmissing-noreturn
170 Warn about functions, which are candidates for the attribute 'noreturn'.
171 .It Fl Wmissing-prototypes
172 Warn if a global function is defined without a previous prototype declaration.
174 Warn if a multicharacter constant ('FOOF') is used.
175 .It Fl Wnested-externs
176 Warn if an 'extern' declaration is encountered within a function.
177 .It Fl Wredundant-decls
178 Warn about redundant declarations, i.e. multiple declarations of the same object or static forward declarations which have no use before their definition.
179 .It Fl Wunreachable-code
180 Warn when the compiler determines that a statement (or in some cases a part thereof) will never be executed.
183 .Fl Wunused-function ,
185 .Fl Wunused-parameter ,
187 .Fl Wunused-variable .
188 .It Fl Wunused-parameter
189 Warn when a parameter is never used or only ever read to calculate its own new value, e.g. x = x + 1.
190 .It Fl Wunused-variable
191 Warn when a variable is never used or only ever read to calculate its own new value, e.g. x = x + 1.
193 Suppress all warnings.
197 to the paths to be searched for include files.
201 to the paths to be searched for libraries.
203 Define the preprocessor macro
205 which will expand to 1.
206 .It Fl D Ns Ar macro=defn
207 Define the preprocessor macro
209 and set its expanded value to
212 Undefine the preprocessor macro
215 Set a frontend or optimizer option.
218 to get a list of supported optimizer options.
220 Set a backend option.
223 to get a list of supported options.
225 Link with the specified library.
227 Specify the output filename.
228 This is only valid when using a single input filename.
230 as filename uses stdout for output.
232 Overwrite the language auto-detection for the following filenames by the
235 Supported values are:
236 .Bl -tag -compact -width "assembler-with-cpp"
239 .It Cm assembler-with-cpp
240 Assembler file, which needs to be preprocessed
248 Revert to auto-detection
253 http://www.libfirm.org/
255 Probably many - if you hit one, please report it.
258 needs to support more switches for better GCC compatibility.
260 This manual page is incomplete.
266 .Aq matze@braunis.de ,
268 .Aq christoph.mallon@gmx.de