Option Type | Default Value | #pragma options | C | C++ |
-qoption | ro* | RO | x | x |
Syntax:
-qro | -qnoro RO | NORO
Purpose
Specifies the storage type for string literals.
Default
The default with xlC, xlc
and c89 is ro. The default with
cc is noro.
Notes
If ro is specified, the compiler places
string literals in read-only storage. If noro is
specified, string literals are placed in read/write storage.
You can also specify the storage type in your source program using:
#pragma strings storage_type
where storage_type is read-only or writable.
Placing string literals in read-only memory can improve runtime performance and save storage, but code that attempts to modify a read-only string literal generates a memory error.
Example
To compile myprogram.c so that the storage type is writable,
enter:
xlC myprogram.c -qnoro
List of Compiler Options and Their
Defaults
Options that Define the Compiler Object
Code Produced