#pragma assert non_zero(sizeof(a) == 12) "a is the wrong size"
In this example, if the compiler determines that sizeof(a) is not 12, the following diagnostic message is output:
"foo.c", line 10: error #2020: The assertion "(sizeof(a) == 12)" was not true. a is the wrong size
Consider the following example that verifies both the size of a struct and the offset of one of its elements:
#include <stddef.h> typedef struct {
int a; int b;
} s;
#pragma assert non_zero(sizeof(s) == 8) "sizeof assert failed" #pragma assert non_zero(offsetof(s,b) == 4) "offsetof assert failed"
This pragma provides a similar behavior to that of the Tru64 C compiler.
BINDING Pragma
#pragma BINDING {hiddenprotectedexterndefault}
Global symbols that follow this pragma will be given a specific binding.
DEFAULT_BINDING Pragma
#pragma DEFAULT_BINDING [symbol{,symbol}]
Global symbols are assigned the default export class. These symbols may be imported or exported outside of the current load module. The compiler will access tentative and undefined symbols through the linkage table. Any symbol that is not assigned to another export class through use of another
ESTIMATED_FREQUENCY Pragma
#pragma ESTIMATED_FREQUENCY f
This
EXTERN Pragma
#pragma EXTERN [symbol{,symbol}]
The specified symbols, or all undefined symbols if no list is provided, are assigned to the default export class. Additionally, the compiler will inline the import stub for calls to these symbols. No compile time binding of these symbols will be done. All references to these symbols will be through the linkage table, so an unnecessary performance penalty will occur if extern is applied to a listed symbol that is resolved in the same load module. This is the pragma equivalent of
FREQUENTLY_CALLED Pragma
#pragma FREQUENTLY_CALLED [symbol{,symbol}]
This
106 Pragma Directives and Attributes