I spent a fair number of hours scrutinizing xDlSym today, and I'd just
like to confirm my understanding.  Despite having worked with C on and
off since the Reagan administration, I was unprepared for 

   void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);

IIUC xDlSym is a pointer to a function taking 3 arguments, returning a
pointer to a "a function", as it says in src/os_unix.c.  That function
has a peculiar signature, 

        void f(void);

You may imagine my resistance.  That's one function I'm sure I've never
needed, nor ever will!  :-)  

The comments also indicate that this definition was created to satisfy
gcc under C90 in pedantic mode.  That suggests that once upon a time
xDlSym would have been defined more conventionally as

   void * (*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol);

but for the never-a-function-pointer-a-void*-shall-be rule of C?

BTW, cdecl.org offers its own interpretation:

        "declare xDlSym as pointer to function (pointer to void, pointer
to void, pointer to const char) returning pointer to function (void)
returning void"   

which, for me at least, is one of those answers that makes sense only
after you know the answer.  

--jkl

Reply via email to