1.3.4. Runtime Model Options

-fcommon, -fno-common

The -fcommon option is enabled by default.

For C source code, this option causes uninitialized global variable definitions to be treated as tentative definitions. If the -fcommon option is enabled, uninitialized global variables are placed in a common block. The linker then resolves all tentative definitions of the same global variable in different compilation units to a single data object definition.

This behavior can be disabled with the -fno-common option.

-fdata-sections, -fno-data-sections

The -fdata-sections option is enabled by default and instructs the c29clang compiler to generate code for the definition of a data object into its own section. This default behavior can be overridden by specifying the fno-datasections on the c29clang command line. You can also dictate what section the data object will be defined in by attaching a section attribute to the data object in the C/C++ source code.

-ffunction-sections, -fno-function-sections

The -ffunction-sections option is enabled by default and instructs the c29clang compiler to generate code for a function definition into its own section. This default behavior can be overridden by specifying the fno-function-sections on the c29clang command line. You can also dictate what section the compiler will generate code for a function definition into by attaching a section attribute to the function in the C/C++ source code.

-fshort-enums, -fno-short-enums

The -fshort-enums option instructs the compiler to only allocate as much space for an enum type data object as is needed to represent the declared range of possible values. This is the default behavior assumed by the c29clang behavior. You can override this default behavior using the -fno-short-enums option that allocates 4 bytes for an enum type data object even if the range of values for a given enum type data object can be represented with fewer bytes.

-fshort-wchar, -fno-short-wchar

The default size for the wchar_t type is 32-bits, which is analogous to the fno-short-wchar option. The runtime libraries provided with the c29clang toolchain installation are all built assuming a wchar_t type size of 32-bits. If you compile a C/C++ source file with the -fshort-wchar option to indicate that the wchar_t type size should be assumed to be 16-bits, you will encounter a link-time warning indicating that the newly compiled object file is not compatible with object files in the runtime libraries.

-funsigned-char, -fsigned-char or -fno-unsigned-char

A plain char type is treated as unsigned char by default in the c29clang compiler. This matches the semantics for the -funsigned-char option. This behavior can be overridden with the use of the -fsigned-char or -fno-unsigned-char option, which indicates that a plain char type is to be interpreted as signed char.