readonly_strings

Controls whether string objects are placed in a read-write or a read-only data section.

Syntax

#pragma readonly_strings on | off | reset

Targets
All platforms.
Remarks

If you enable this pragma, C strings used in your source code (for example, "hello") are output to the read-only data section instead of the global data section. In effect, these strings act like const char *, even though their type is really char *.

This pragma corresponds to the Make strings read-only setting in the processor x86 CodeGen panel and the Make string constants read-only setting in the processor ARM CodeGen panel. To check this setting, use __option (readonly_strings), described in Checking Settings. The default setting is off.