-->

Previous | Table of Contents | Next

Page 179

The preprocessor predefines a macro __STRICT_ANSI__ when you use the _ansi option. Some header files may notice this macro and refrain from declaring certain functions or defining certain macros that the ANSI standard doesn't call for; this is to avoid interfering with any programs that might use these names for other things.
_fno_asm Do not recognize asm, inline, or typeof as a keyword. These words may then be used as identifiers. You can use __asm__, __inline__, and __typeof__ instead. _ansi implies _fno_asm.
_fno_builtin Don't recognize built-in functions that do not begin with two leading underscores. Currently, the functions affected include _exit, abort, abs, alloca, cos, exit, fabs, labs, memcmp, memcpy, sin, sqrt, strcmp, strcpy,and strlen. The _ansi option prevents alloca and _exit from being built-in functions.
_fno_strict_prototype Treat a function declaration with no arguments, such as int foo();, as C would treat it—as saying nothing about the number of arguments or their types (C++ only). Normally, such a declaration in C++ means that the function foo takes no arguments.
_trigraphs Support ANSI C trigraphs. The _ansi option implies _trigraphs.
_traditional Attempt to support some aspects of traditional C compilers. For details, see the GNU C Manual; the duplicate list here has been deleted so that we won't get complaints when it is out of date. But one note about C++ programs only (not C). _traditional has one additional effect for C++: assignment to this is permitted. This is the same as the effect of _fthis_is_variable.
_traditional_cpp Attempt to support some aspects of traditional C preprocessors. This includes the items that specifically mention the preprocessor previously, but none of the other effects of _traditional.
_fdollars_in_identifiers Permit the use of $ in identifiers (C++ only). You can also use _fno_dollars_in_identifiers to explicitly prohibit use of $. (GNU C++ allows $ by default on some target systems but not others.)
_fenum_int_equiv Permit implicit conversion of int to enumeration types (C++ only). Normally GNU C++ allows conversion of enum to int, but not the other way around.
fexternal_templates Produce smaller code for template declarations, by generating only a single copy of each template function where it is defined (C++ only). To use this option successfully, you must also mark all files that use templates with either #pragma implementation (the definition) or #pragma interface (declarations). When your code is compiled with _fexternal_templates, all template instantiations are external. You must arrange for all necessary instantiations to appear in the implementation file; you can do this with a typedef that references each instantiation needed. Conversely, when you compile using the default option _fno_external_templates, all template instantiations are explicitly internal.
_fall_virtual Treat all possible member functions as virtual, implicitly. All member functions (except for constructor functions and new or delete member operators) are treated as virtual functions of the class where they appear. This does not mean that all calls to these member functions will be made through the internal table of virtual functions. Under some circumstances, the compiler can determine that a call to a given virtual function can be made directly; in these cases, the calls are direct in any case.
_fcond_mismatch Allow conditional expressions with mismatched types in the second and third arguments. The value of such an expression is void.
_fthis_is_variable Permit assignment to this (C++ only). The incorporation of user-defined free store management into C++ has made assignment to this an anachronism. Therefore, by default it is invalid to assign to this within a class member function. However, for backwards compatibility, you can make it valid with _fthis-is-variable.
_funsigned_char Let the type char be unsigned, like unsigned char. Each kind of machine has a default for what char should be. It is either like unsigned char by default or like signed char by default.

Page 180

Ideally, a portable program should always use signed char or unsigned char when it depends on the signedness of an object. But many programs have been written to use plain char and expect it to be signed, or expect it to be unsigned, depending on the machines they were written for. This option, and its inverse, lets you make such a program work with the opposite default. The type char is always a distinct type from each of signed char and unsigned char, even though its behavior is always just like one of those two.
_fsigned_char Let the type char be signed, like signed char. Note that this is equivalent to _fno_unsigned_char, which is the negative form of _funsigned_char. Likewise, _fno_signed_char is equivalent to _funsigned_char.
_fsigned_bitfields These options control whether a bitfield is signed or unsigned, when declared with no explicit
_funsigned_bitfields or unsigned qualifier.
_fno_signed_bitfields By default, such a bitfield is signed, because this is consistent: The basic integer types such as int
_fno_unsigned_bitfields signed are signed types. However, when you specify _traditional, bitfields are all unsigned no matter what.
_fwritable_strings Store string constants in the writable data segment and don't uniquize them. This is for compatibility with old programs which assume they can write into string constants. _traditional also has this effect. Writing into string constants is a very bad idea; constants should be constant.

PREPORCESSOR OPTIONS

These options control the C preprocessor, which is run on each C source file before actual compilation.

If you use the _E option, gcc does nothing except preprocessing. Some of these options make sense only together with _E because they cause the preprocessor output to be unsuitable for actual compilation.

_include file Process file as input before processing the regular input file. In effect, the contents of file are compiled first. Any _D and _U options on the command line are always processed before
_include file, regardless of the order in which they are written. All the _include and _imacros options are processed in the order in which they are written.
_imacros file Process file as input, discarding the resulting output, before processing the regular input file. Because the output generated from file is discarded, the only effect of _imacros file is to make the macros defined in file available for use in the main input. The preprocessor evaluates any
_D and _U options on the command line before processing _imacros file, regardless of the order in which they are written. All the _include and _imacros options are processed in the order in which they are written.
_idirafter dir Add the directory dir to the second include path. The directories on the second include path are searched when a header file is not found in any of the directories in the main include path (the one that _I adds to).
_iprefix prefix Specify prefix as the prefix for subsequent _iwithprefix options.
_iwithprefix dir Add a directory to the second include path. The directory's name is made by concatenating prefix and dir, where prefix was specified previously with _iprefix.
_nostdinc Do not search the standard system directories for header files. Only the directories you have specified with _I options (and the current directory, if appropriate) are searched. By using both _nostdinc and _I_, you can limit the include file search file to only those directories you specify explicitly.
_nostdinc++ Do not search for header files in the C++_specific standard directories, but do still search the other standard directories. (This option is used when building libg++.)
_undef Do not predefine any nonstandard macros (including architecture flags).
_E Run only the C preprocessor. Preprocess all the C source files specified and output the results to standard output or to the specified output file.
_C Tell the preprocessor not to discard comments. Used with the _E option.

Previous | Table of Contents | Next