-qro

Description

Specifies the storage type for string literals.

Syntax

Read syntax diagramSkip visual syntax diagram        .-ro---.
>>- -q--+-noro-+-----------------------------------------------><

See also #pragma options.

Default

The default for all compiler invocations except cc and its derivatives is -qro. The default for the cc compiler invocation is -qnoro.

Notes

If -qro is specified, the compiler places string literals in read-only storage. If -qnoro 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 may generate a memory error.

Example

To compile myprogram.c so that the storage type is writable, enter:

xlc myprogram.c -qnoro

Related information