Node: Objective-C Dialect Options, Next: , Previous: C++ Dialect Options, Up: Invoking GCC



Options Controlling Objective-C Dialect

This section describes the command-line options that are only meaningful for Objective-C programs; but you can also use most of the GNU compiler options regardless of what language your program is in. For example, you might compile a file some_class.m like this:

     gcc -g -fgnu-runtime -O -c some_class.m
     

In this example, only -fgnu-runtime is an option meant only for Objective-C programs; you can use the other options with any language supported by GCC.

Here is a list of options that are only for compiling Objective-C programs:

-fconstant-string-class=class-name
Use class-name as the name of the class to instantiate for each literal string specified with the syntax @"...". The default class name is NXConstantString.
-fgnu-runtime
Generate object code compatible with the standard GNU Objective-C runtime. This is the default for most types of systems.
-fnext-runtime
Generate output compatible with the NeXT runtime. This is the default for NeXT-based systems, including Darwin and Mac OS X.
-gen-decls
Dump interface declarations for all classes seen in the source file to a file named sourcename.decl.
-Wno-protocol
Do not warn if methods required by a protocol are not implemented in the class adopting it.
-Wselector
Warn if a selector has multiple methods of different types defined.