Allocates one or more variables in the specified section. Controls section attribute specification for variables.
- A variable that can be used to define a symbol in the section.
- A comma-separated list of attributes; defined values are: 'short' and 'long'.
alloc_sectionpragma places the listed variables,
var2, etc., in the specified section. This pragma controls section attribute specification for variables. The compiler decides whether the variable, as defined by
var2, etc., should go to a "data", "bss", or "rdata" section.
The section name must be enclosed in double quotation marks. It should be previously introduced into the program using
#pragma section. The list of comma-separated variable names follows the section name after a separating comma.
All listed variables must be defined before this pragma, in the same translation unit and in the same scope. The variables have static storage; their linkage does not matter in C modules, but in C++ modules they are defined with the extern "C" linkage specification.
Example: Using #pragma alloc_section