4.3.13 __ro_placement Keyword

The __ro_placement attribute specifies that a data object should be placed in read-only memory.

For XC32, the const qualifier implies that the qualified variable is read only. Because of this, any variables (except auto variables or function parameters) qualified const are placed in program memory, thus freeing valuable data RAM.

Suggested Replacement

const

Caveats

None.

Examples

Consider migrating IAR code such as:

__ro_placement const volatile int x = 10;
to MPLAB XC codes similar to:
const int xc = 32;

Further Information

None.