4.75 _Pragma preprocessing operator in C99

C90 does not permit a #pragma directive to be produced as the result of a macro expansion. However, the C99 _Pragma operator enables you to embed a preprocessor macro in a pragma directive.

_Pragma is permitted in C90 if --strict is not specified.
For example:
# define RWDATA(X) PRAGMA(arm section rwdata=#X)
# define PRAGMA(X) _Pragma(#X)
RWDATA(foo)  // same as #pragma arm section rwdata="foo"
int y = 1;   // y is placed in section "foo"
Related concepts
4.62 New language features of C99
4.64 // comments in C99 and C90
4.65 Compound literals in C99
4.66 Designated initializers in C99
4.67 Hexadecimal floating-point numbers in C99
4.68 Flexible array members in C99
4.69 __func__ predefined identifier in C99
4.70 inline functions in C99
4.71 long long data type in C99 and C90
4.72 Macros with a variable number of arguments in C99
4.73 Mixed declarations and statements in C99
4.74 New block scopes for selection and iteration statements in C99
4.76 Restricted pointers in C99
4.78 Complex numbers in C99
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.