Node: Objective-C Dialect Options, Next: Language Independent Options, Previous: C++ Dialect Options, Up: Invoking GCC
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, -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
@"..."
. The default
class name is NXConstantString
.
-fgnu-runtime
-fnext-runtime
__NEXT_RUNTIME__
is predefined if (and only if) this option is
used.
-gen-decls
sourcename.decl
.
-Wno-protocol
-Wno-protocol
option, then
methods inherited from the superclass are considered to be implemented,
and no warning is issued for them.
-Wselector
@selector(...)
expression, and a corresponding method for that selector has been found
during compilation. Because these checks scan the method table only at
the end of compilation, these warnings are not produced if the final
stage of compilation is not reached, for example because an error is
found during compilation, or because the -fsyntax-only
option is
being used.
-Wundeclared-selector
@selector(...)
expression referring to an
undeclared selector is found. A selector is considered undeclared if no
method with that name has been declared before the
@selector(...)
expression, either explicitly in an
@interface
or @protocol
declaration, or implicitly in
an @implementation
section. This option always performs its
checks as soon as a @selector(...)
expression is found,
while -Wselector
only performs its checks in the final stage of
compilation. This also enforces the coding style convention
that methods and selectors must be declared before being used.