How to declare a pointer to function in C, in order that the pointer itself is volatile.
static void volatile (* f_pointer)(void*);
static void (volatile * f_pointer)(void*);
static void (* volatile f_pointer)(void*);
Why I asking this? I read at http://wiki.answers.com/Q/Volatile_example_code_sample_coding_of_volatile_pointer about volatile pointers.
There are sometimes problems with volatile pointers and pointer-to volatile:
Now, it turns out that pointers to volatile variables are very common. Both of these declarations declare foo to be a pointer to a volatile integer:
volatile int * foo;
int volatile * foo;
Volatile pointers to non-volatile variables are very rare (I think I've used them once), but I'd better go ahead and give you the syntax:
int * volatile foo;
So, I want to get a volatile pointer to function not a pointer to "volatile" function.
Thanks