> > There is also one function cast warning from gnulib code: > > C:/emacs/git/emacs/master/lib/gettimeofday.c: In function 'initialize': > > C:/emacs/git/emacs/master/lib/gettimeofday.c:48:9: warning: cast between > > incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to > > 'void (*)(FILETIME *)' {aka 'void (*)(struct _FILETIME *)'} > > [-Wcast-function-type] > > (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress > > (kernel32, "GetSystemTimePreciseAsFileTime"); > > ^
The cast is there, because the results of GetProcAddress or dlsym need to be cast to the proper function type before they can be invoked. This code uses GetProcAddress so that it can exploit features of newer Windows versions while at the same time still work on older Windows versions. The warning is there because you specified -Wcast-function-type. You *wanted* to get informed about the cast. You got informed. So, there are 4 options: 1) Use static reference to Windows API functions. 2) Use '#pragma GCC diagnostic ignored "-Wcast-function-type"' 3) Remove -Wcast-function-type from the compiler options. 4) Live with the warning. I'm opposed to 1), since it removes either features or portability. I could do 2), but it does not feel like the right thing, to silence a compiler warning when the user has explicitly requested a warning. So, please choose among 3) and 4). Bruno