6.48. Pragmas Accepted by GCC

GCC supports several types of pragmas, primarily in order to compile code originally written for other compilers. Note that in general we do not recommend the use of pragmas; Section 6.26 Declaring Attributes of Functions, for further explanation.

6.48.1. RS/6000 and PowerPC Pragmas

The RS/6000 and PowerPC targets define one pragma for controlling whether or not the longcall attribute is added to function declarations by default. This pragma overrides the -mlongcall option, but not the longcall and shortcall attributes. Section 4.17.2 IBM RS/6000 and PowerPC Options, for more information about when long calls are and are not necessary.

longcall (1)

Apply the longcall attribute to all subsequent function declarations.

longcall (0)

Do not apply the longcall attribute to subsequent function declarations.

6.48.2. Solaris Pragmas

For compatibility with the SunPRO compiler, the following pragma is supported.

redefine_extname oldname newname

This pragma gives the C function oldname the assembler label newname. The pragma must appear before the function declaration. This pragma is equivalent to the asm labels extension (refer to Section 6.39 Controlling Names Used in Assembler Code). The preprocessor defines __PRAGMA_REDEFINE_EXTNAME if the pragma is available.

6.48.3. Tru64 Pragmas

For compatibility with the Compaq C compiler, the following pragma is supported.

extern_prefix string

This pragma renames all subsequent function and variable declarations such that string is prepended to the name. This effect may be terminated by using another extern_prefix pragma with the empty string.

This pragma is similar in intent to to the asm labels extension (refer to Section 6.39 Controlling Names Used in Assembler Code) in that the system programmer wants to change the assembly-level ABI without changing the source-level API. The preprocessor defines __PRAGMA_EXTERN_PREFIX if the pragma is available.