Table of Contents        Previous topic       Next topic       

C/C++ COMPILER->Pragmas->#pragma const_seg

#pragma const_seg( ["section-name"] )

The const_seg pragma specifies the romable data section where constants are to be placed. Section name can be any valid string contant.  To avoid conflict with the default sections used by the compiler, avoid using names beginning with a double underscore.

Using #pragma const_seg without a section-name string resets allocation to the default section.


#pragma const_seg(MYCONST)

const int i = 98;

#pragma const_seg()

const int j = 103;

i will be placed in romable data section MYCONST.  j will be placed in default const section.