[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


pcrelstrings

Description:

Controls the storage and reference of string literals from the program counter.

Compatibility:

This pragma is compatible with the following platform targets:

68K

PowerPC
NEC V800
Intel x86
MIPS

Embedded 68K

Prototype:
  #pragma pcrelstrings on | off | reset Remarks:

If this option is on, the compiler stores the string constants used in a local scope in the code segment and addresses these strings with PC-relative instructions. If this option is off, the compiler stores all string constants in the global data segment. Regardless of how this option is set, the compiler stores string constants used in the global scope in the global data segment. For example:


#pragma pcrelstrings on
int foo(char *);

int x = f("Hello");  // "Hello" is allocated in
                     // the global data segment
int bar()
{
  return f("World"); //"World" is allocated in the code segment
}                    // (pc-relative)

Strings in C++ initialization code are always allocated in the global data segment.


NOTE

If you turn the pool_strings pragma on, the compiler ignores the setting of the pcrelstrings pragma.

This pragma corresponds to the PC-Relative Strings option in the 68K Processor settings panel. To check whether this option is on, use __option (pcrelstrings), described in "Checking Options." By default, this option is off.


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 17, 2000