on-internet
← Community

What's the purpose of this [1] at the end of struct declaration?

Stack Overflow ·

I was snooping through my MSP430 microcontroller's header files, and I ran into this in <setjmp.h>: /* r3 does not have to be saved */ typedef struct { uint32_t __j_pc; /* return address */ uint32_t __j_sp; /* r1 stack pointer */ uint32_t __j_sr; /* r2 status register */ uint32_t __j_r4; uint32_t __j_r5; uint32_t __j_r6; uint32_t __j_r7; uint32_t __j_r8; uint32_t __j_r9; uint32_t __j_r10; uint32_t __j_r11; } jmp_buf[1]; /* size = 20 bytes */ I understand that it declares an anonymous struct and typedef's it to jmp_buf, but I can't figure out what the [1] is for. I know it declares jmp_buf to b

Comments

Sign in or sign up to comment and upvote.

No comments yet.