Specifies the addressing mode and location of object code for constant character strings.
#pragma STRING_SEG [ modifier ] [ name ]
#pragma STRING_SEG DEFAULT
modifier
This optional parameter specifies the addressing mode to use:
name
A section name. You must use a section name defined in your project's linker command file.
To specify the section in which the constant character strings is to be stored and the addressing mode to refer to this data, place this pragma before character string literal values. Use this pragma when porting source code for HC08 architectures to Kinetis architectures.
Use DEFAULT to use the parameters specified in the previous use of this pragma.
The following listing shows an example.
/* Place "longitude" and "altitude" in section rodata. */ const char* s1 = "longitude"; char* s2 = "altitude"; /* Place "latitude" in section sdata. */ char s3[50] = "latitude"; #pragma STRING_SEG MYSTRINGS /* Place "liberty" and "fraternity" in section MYSTRINGS. */ const char* s4 = "liberty"; char* s5 = "fraternity"; /* "equality" will go in section sdata. */ char s6[50] = "equality";