Hi I need some help in understand some C code:
#if 0
some C code 1
#elif 0
static int8 arry[10];
#pragma Align_to(32, arry)
ASSERT(((int8ptr_t)arry) & 15) == 0)
#else
ASSERT(((int8ptr_t)arry) & 15) == 0)
#endif
My questions:
Is only the #else
part compiled?
What is the meaning of #pragma Align_to(32, arry)
in the #elif 0
case?
Yes, the #else
part is what is compiled.
The #pragma
directive is a compiler specific directive. As you compiler was not specified, it could mean anything.
In your case #pragma Align_to(32, arry)
, likely tells the compiler to insure variable 'arry' is place in memory on a 32 byte boundary. This is typically for performance reasons or compatibility concerns. You may also want to look into the keyword __attribute__
use to control similar variable attributes.