Can pragma directives be nested?
For storing source code and data in nested mode, combinations of #pragma preprocessing directives are permitted exclusively.
Example
#pragma clang section text=".myfunc" data=".mydata"
int foo3 = 5;
int add3(int foo3)
{
for (int i = 0; i < 10; i++) {}
return foo3+3;
}
#pragma clang section text="" data=""
Alternatively
#pragma clang section text=".myfunc"
#pragma clang section data=".mydata"
int foo3 = 5;
#pragma clang section data=""
int add3(int foo3)
{
for (int i = 0; i < 10; i++) {}
return foo3+3;
}
#pragma clang section text=""
Both of these examples generate the same result.