| Syntax: | Default: |
| gen(readOnlyConst[, yes]) gen(readOnlyConst, no) |
gen(readOnlyConst, yes) |
This option controls whether constant values are placed in read-only or read-write storage.
By default, constant values are placed in the default data section.
If readOnlyConst is set to yes, constant values are placed in read-only storage. Only constants that do not contain addresses can be put into read-only memory.
Placing constant values in read-only memory can improve run-time performance, save storage, and provide shared access. Code that attempts to modify a read-only constant value generates a memory error.
In the context of the readOnlyConst code generation option, constant value refers to variables that are qualified by const (including const-qualified characters, integers, floats, enumerations, structures, unions, and arrays). This option does not apply to the following variables:
The gen(readOnlyConst) option does not imply the gen(readOnly) option. Both options must be used if you wish to specify the storage characteristics of both string literals (gen(readOnly)) and constant values (gen(readOnlyConst)).
You can also control how constant values are stored by using #pragma options [no]roconst. The pragma overrides the configuration file option.
![]()
Incremental C++ Build
C Compilation
Configuration
Files
![]()
Sections and Segments
![]()
Code Generation Options
![]()
Code Generation Options
