### Checking Settings

The preprocessor function __option() lets you check pragmas and other settings that control the C/C++ compiler and code generation. You typically modify these settings using various panels in the Project Settings window.

The syntax for this preprocessor function is as follows:

__option(setting-name)

If the specified setting is enabled, __option() returns 1; otherwise it returns 0.

To determine if a setting-name is invalid, see Warnings as Errors.

Use this function when you want one source file to contain code that uses different settings. The example below shows how to compile one series of lines if you are compiling for machines with the MC68881 floating-point unit and another series if you are compiling for machines without it:

#if __option (code68881) // Code for 68K chip with FPU
#else
// Code for any 68K processor
#endif

Table 1 lists all the setting names you can use in the preprocessor function __option().

##### Table 1. Preprocessor Setting Names for __option()

This argument... | Corresponds to the…
--- | ---
a6frames | Pragma a6frames.
align_array_members | Pragma align_array_members.
altivec_codegen | Pragma altivec_codegen.
altivec_model | Pragma altivec_model.
altivec_vrsave | Pragma altivec_vrsave.
always_inline | Pragma always_inline.
ANSI_strict | ANSI Strict setting and pragma ANSI_strict.
arg_dep_lookup | Pragma arg_dep_lookup.
ARM_conform | Pragma ARM_conform.
array_new_delete | Pragma array_new_delete
auto_inline | Auto-Inline setting of the Inlining menu and pragma auto_inline.
bool | Enable bool Support setting and pragma bool.
check_header_flags | Pragma check_header_flags.
code68020 | Pragma code68020.
code68881 | Pragma code68881.
const_multiply | Pragma const_multiply.
const_strings | Pragma const_strings.
cplusplus | Force C++ Compilation setting , the pragma cplusplus, and the macro cplusplus. Indicates whether the compiler is compiling this file as a C++ file.
cpp_extensions | Pragma cpp_extensions.
d0_pointers | Pragmas pointers_in_D0 and pointers_in_A0.
def_inherited | Pragma def_inherited.
defer_codegen | Pragma defer_codegen.
defer_defarg_parsing | Pragma defer_defarg_parsing
direct_destruction | No longer available
direct_to_SOM | Pragma direct_to_SOM.
disable_registers | Pragma disable_registers.
dollar_identifiers | Pragma dollar_identifiers.
dont_inline | Don’t Inline setting and pragma dont_inline.
dont_reuse_strings | Reuse Strings setting and pragma dont_reuse_strings.
ecplusplus | Pragma ecplusplus.
EIPC_EIPSW | Pragma EIPC_EIPSW.
enumsalwaysint | Enums Always Int setting and pragma enumsalwaysint.
exceptions | Enable C++ Exceptions setting and pragma exceptions.
export | Pragma export.
extended_errorcheck | Extended Error Checking setting and pragma extended_errorcheck.
far_data | Pragma far_data.
far_strings | Pragma far_strings.
far_vtables | Pragma far_vtables.
faster_pch_gen | Pragma faster_pch_gen.
float_constants | Pragma float_constants.
force_active | Pragma force_active.
fourbyteints | Pragma fourbyteints.
fp_contract | Pragma fp_contract.
fullpath_prepdump | Pragma fullpath_prepdump.
function_align | Pragma function_align.
gcc_extensions | Pragma gcc_extensions.
IEEEdoubles | Pragma IEEEdoubles.
ignore_oldstyle | Pragma ignore_oldstyle.
import | Pragma import.
inline_bottom_up | Pragma inline_bottom_up.
inline_bottom_up_once | Pragma inline_bottom_up_once
inline_intrinsics | Pragma inline_intrinsics.
inline_max_auto_size | Pragma inline_max_auto_size
inline_max_size | Pragma inline_max_size
inline_max_total_size | Pragma inline_max_total_size
internal | Pragma internal.
interrupt | Pragma interrupt.
k63d | K6 3D Favored setting in the Extended Instruction Set menu of the x86 CodeGen panel and pragma k63d.
k63d_calls | MMX + K6 3D setting in the Extended Instruction Set menu of the x86 CodeGen panel and pragma k63d_calls.
lib_export | Pragma lib_export.
line_prepdump | Pragma line_prepdump.
little_endian | No option. Defined as 1 if you are compiling for a little endian target (such as x86); 0 if you are compiling for a big endian target (such as PowerPC).
longlong | Pragma longlong.
longlong_enums | Pragma longlong_enums.
longlong_prepeval | Pragma longlong_prepeval.
macsbug | Pragma macsbug.
max_errors | Pragma max_errors
microsoft_exceptions | Pragma microsoft_exceptions.
microsoft_RTTI | Pragma microsoft_RTTI.
mmx | MMX setting in the Extended Instruction Set menu of the x86 CodeGen panel and pragma mmx.
mmx_call | Pragma mmx_call.
mpwc | Pragma mpwc.
mpwc_newline | Pragma mpwc_newline.
mpwc_relax | Pragma mpwc_relax.
msg_show_lineref | Pragma msg_show_lineref
msg_show_realref | Pragma msg_show_realref
multibyteaware_ preserve_literals | Pragma multibyteaware_ preserve_literals
no_conststringconv | Pragma no_conststringconv
no_register_coloring | Pragma no_register_coloring.
no_static_dtors | Pragma no_static_dtors.
no_conststringconv | Pragma no_conststringconv
oldstyle_symbols | Pragma oldstyle_symbols.
only_std_keywords | ANSI Keywords Only setting and pragma only_std_keywords.
opt_classresults | Pragma opt_classresults
opt_common_subs | Pragma opt_common_subs.
opt_dead_assignments | Pragma opt_dead_assignments.
opt_dead_code | Pragma opt_dead_code.
opt_lifetimes | Pragma opt_lifetimes.
opt_loop_invariants | Pragma opt_loop_invariants.
opt_propagation | Pragma opt_propagation.
opt_strength_reduction | Pragma opt_strength_reduction.
opt_strength_reduction_strict | Pragma opt_strength_reduction_strict.
opt_unroll_loops | Pragma opt_unroll_loops.
opt_vectorize_loops | Pragma opt_vectorize_loops.
optimize_for_size | Pragma optimize_for_size.
optimizewithasm | Pragma optimizewithasm.
pool_data | Pragma pool_data.
pool_strings | Pool Strings setting and pragma pool_strings.
ppc_unroll_speculative | Pragma ppc_unroll_speculative.
precompile | Whether or not the file is precompiled.
preprocess | Whether or not the file is preprocessed.
profile | Pragma profile.
readonly_strings | Pragma readonly_strings.
register_coloring | Pragma register_coloring.
require_prototypes | Require Function Prototypes setting and pragma require_prototypes.
RTTI | Enable RTTI setting and pragma RTTI.
showmessagenumber | Pragma showmessagenumber
side_effects | Pragma side_effects.
simple_prepdump | Pragma simple_prepdump.
SOMCallOptimization | Pragma SOMCallOptimization.
SOMCheckEnvironment | Pragma SOMCheckEnvironment.
stack_cleanup | Pragma stack_cleanup.
suppress_init_code | Pragma suppress_init_code.
suppress_warnings | Pragma suppress_warnings.
sym | Marker in the project window debug column and pragma sym.
syspath_once | Pragma syspath_once.
text_encoding | Pragma text_encoding
toc_data | Pragma toc_data.
traceback | Pragma traceback.
trigraphs | Expand Trigraphs setting and pragma trigraphs.
unsigned_char | Use Unsigned Chars setting and pragma unsigned_char.
use_fp_instructions | Pragma use_fp_instructions.
use_frame | Pragma use_frame.
use_mask_registers | Pragma use_mask_registers.
warning | Pragma warning
warn_any_ptr_int_conv | Pragma warn_any_ptr_int_conv
warn_emptydecl | Empty Declarations setting and pragma warn_emptydecl.
warn_extracomma | Extra Commas setting and pragma warn_extracomma.
warn_hiddenlocals | Pragma warn_hiddenlocals
warn_hidevirtual | Hidden virtual functions setting and pragma warn_hidevirtual.
warn_illegal_instructions | Pragma warn_illegal_instructions.
warn_illpragma | Illegal Pragmas setting and pragma warn_illpragma.
warn_illtokenpasting | Pragma warn_illtokenpasting
warn_illunionmembers | Pragma warn_illunionmembers
warn_impl_f2i_conv | Pragma warn_impl_f2i_conv.
warn_impl_i2f_conv | Pragma warn_impl_i2f_conv.
warn_impl_s2u_conv | Pragma warn_impl_s2u_conv.
warn_implicitconv | Implicit Arithmetic Conversions setting and pragma warn_implicitconv.
warn_missingreturn | Pragma warn_missingreturn
warn_no_explicit_virtual | Pragma warn_no_explicit_virtual
warn_no_side_effect | pragma warn_no_side_effect.
warn_notinlined | Non-Inlined Functions setting and pragma warn_notinlined.
warn_padding | pragma warn_padding.
warn_possunwant | Possible Errors setting and pragma warn_possunwant.
warn_ptr_int_conv | pragma warn_ptr_int_conv.
warn_resultnotused | pragma warn_resultnotused.
warn_structclass | Inconsistent ‘class’ / ‘struct’ Usage setting and pragma warn_structclass.
warn_undefmacro | pragma warn_undefmacro
warn_unusedarg | Unused Arguments setting and pragma warn_unusedarg.
warn_unusedvar | Unused Variables setting and pragma warn_unusedvar.
warning_errors | Treat Warnings As Errors setting and pragma warning_errors.
wchar_type | Enable wchar_t Support setting and pragma wchar_type.