pointer to printf causes triple fault?!
Posted: Sun Sep 01, 2002 11:00 pm
Here's a strange one:
Initially I had:
void printf(const char *format, ...);
Now I want to be able to redefine the main printing method (long story), so I've got:
void kprintf(const char *format, ...); // used to be just printf
void (*printf)(const char *format, ...) = *kprintf;
And... now I've got a triple fault on my hands. This makes no sense to me. Is there some subtle problem with pointers to functions containing ellipsis?
Or... I just thought of this... perhaps could gcc be making an assumption about printf? In other words, it thinks it's defined as it would be in libc?
Thanks,
Jeff
Initially I had:
void printf(const char *format, ...);
Now I want to be able to redefine the main printing method (long story), so I've got:
void kprintf(const char *format, ...); // used to be just printf
void (*printf)(const char *format, ...) = *kprintf;
And... now I've got a triple fault on my hands. This makes no sense to me. Is there some subtle problem with pointers to functions containing ellipsis?
Or... I just thought of this... perhaps could gcc be making an assumption about printf? In other words, it thinks it's defined as it would be in libc?
Thanks,
Jeff