roconst

Option Type Default Value #pragma options C C++
-qoption roconst* ROCONST x x

Syntax

    -qroconst | -qnoroconst 
    ROCONST | NOROCONST 

Purpose
Specifies the storage location for constant values.

Default
The default with xlC, xlc and c89 is roconst. The default with cc is noroconst.

Notes
If -qroconst is specified, the compiler places constants in read-only storage. If -qnoroconst is specified, constant values are placed in read/write storage.

Placing constant values in read-only memory can improve runtime performance, save storage, and provide shared access. Code that attempts to modify a read-only constant value generates a memory error.

Constant value in the context of the -qroconst option refers to variables that are qualified by const (including const-qualified characters, integers, floats, enumerations, structures, unions, and arrays). The following variables do not apply to this option:

The -qroconst option does not imply the -qro option. Both options must be specified if you wish to specify storage characteristics of both string literals (-qro) and constant values (-qroconst).



List of Batch Compiler Options and Their Defaults
Options that Define the Compiler Object Code Produced
Equivalent Batch Compile-Link and Incremental Build Options