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:
@"...". The default class name is
__NEXT_RUNTIME__is predefined if (and only if) this option is used.
-Wno-protocoloption, then methods inherited from the superclass are considered to be implemented, and no warning is issued for them.
@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-onlyoption is being used.
@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
@protocoldeclaration, or implicitly in an
@implementationsection. This option always performs its checks as soon as a
@selector(...)expression is found, while
-Wselectoronly 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.