Reputation: 1697
I encountered the following code snippet within a cstartup file for a cortex m0 micro - cstartup_M.c
#pragma location = ".intvec"
__root const intvec_elem __vector_table[] =
{
{ .__ptr = __sfe( "CSTACK" ) },
__iar_program_start,
NonMaskableInt_Handler,
HardFault_Handler,
Could someone please explain the syntax within the line: { .__ptr = __sfe( "CSTACK" ) },
Specifically:
.__ptr
?Upvotes: 1
Views: 136
Reputation: 92994
That's the new C99 initialization syntax. An initializer of the form
.field = value
initializes structure member field
to value
instead of initializing the next structure member in order.
Upvotes: 3