I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value.
I could swear I
Here is another way:
static void
unhandled_interrupt(struct trap_frame *frame, int irq, void *arg)
{
//this code intentionally left blank
}
static struct irqtbl_s vector_tbl[XCHAL_NUM_INTERRUPTS] = {
[0 ... XCHAL_NUM_INTERRUPTS-1] {unhandled_interrupt, NULL},
};
See:
C-Extensions
Designated inits
Then ask the question: When can one use C extensions?
The code sample above is in an embedded system and will never see the light from another compiler.