Compiler warning and a confusing function declaration.
OK basically I have a (probably harmless) compiler warning that, for the sake of completeness, I would like to remove if possible (go easy on me please, I'm a newbie). The key bits are (I think) ...
askfor_aux and askfor_aux_keypress functions (and keypress_h function?) declared in a .h include file.
warning C4550: expression evaluates to a function which is missing an argument list
askfor_aux_keypress function defined.
extern bool askfor_aux_keypress(char *buf, size_t buflen, size_t *curs, size_t *len, char keypress, bool firsttime);
extern bool askfor_aux(char *buf, size_t len, bool keypress_h(char *, size_t, size_t *, size_t *, char, bool));
Function defined, and assignment made of function pointer.
askfor_aux function defined
bool askfor_aux_keypress(char *buf, size_t buflen, size_t *curs, size_t *len, char keypress, bool firsttime)
... skip rest ...
Now the things I don't quite know are
bool askfor_aux(char *buf, size_t len, bool keypress_h(char *, size_t, size_t *, size_t *, char, bool))
... skip bits ...
keypress_h = askfor_aux_keypress;
1) What's happening with that "declare a function inside a function declaration" thing that seems to be going on with keypress_h?
2) The intermediate keypress_h function pointer seems to be used to make it easy to switch out askfor_aux_keypress with a different function to handle collecting keypresses. However there are no alternative functions so I guess I can just ditch that bit and use askfor_aux_keypress directly?
Oh, and like I asked at the top, 3) Why the warning, and can I get rid of it? (Other than just suppressing C4550 ;) )
[EDIT]Coming to think of it the fourth thing I don't get is why the rather similar looking assignments like ...
don't prompt the same compiler warning.
ang_sort_comp = ang_sort_comp_hook_longs;
extern bool (*ang_sort_comp)(const void *u, const void *v, int a, int b);
static bool ang_sort_comp_hook_longs(const void *u, const void *v, int a, int b)