+2018-08-18 Bruno Haible <bruno@clisp.org>
+
+ Avoid -Wcast-function-type warnings from casts after GetProcAddress.
+ Reported by Andy Moreton <andrewjmoreton@gmail.com> in
+ <https://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00468.html>.
+ Solution proposed by Eli Zaretskii.
+ * lib/getaddrinfo.c (GetProcAddress): Cast result to 'void *' first.
+ * lib/gettimeofday.c (GetProcAddress): Likewise.
+ * lib/link.c (GetProcAddress): Likewise.
+ * lib/physmem.c (GetProcAddress): Likewise.
+ * lib/poll.c (GetProcAddress): Likewise.
+ * lib/select.c (GetProcAddress): Likewise.
+ * lib/stat-w32.c (GetProcAddress): Likewise.
+
2018-08-18 Bruno Haible <bruno@clisp.org>
glob: Fix another compilation error when glob.h is not replaced.
#include "sockets.h"
#ifdef WINDOWS_NATIVE
+
+/* Avoid warnings from gcc -Wcast-function-type. */
+# define GetProcAddress \
+ (void *) GetProcAddress
+
typedef int (WSAAPI *getaddrinfo_func) (const char*, const char*,
const struct addrinfo*,
struct addrinfo**);
#ifdef WINDOWS_NATIVE
+/* Avoid warnings from gcc -Wcast-function-type. */
+# define GetProcAddress \
+ (void *) GetProcAddress
+
/* GetSystemTimePreciseAsFileTime was introduced only in Windows 8. */
typedef void (WINAPI * GetSystemTimePreciseAsFileTimeFuncType) (FILETIME *lpTime);
static GetSystemTimePreciseAsFileTimeFuncType GetSystemTimePreciseAsFileTimeFunc = NULL;
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+/* Avoid warnings from gcc -Wcast-function-type. */
+# define GetProcAddress \
+ (void *) GetProcAddress
+
/* CreateHardLink was introduced only in Windows 2000. */
typedef BOOL (WINAPI * CreateHardLinkFuncType) (LPCTSTR lpFileName,
LPCTSTR lpExistingFileName,
#endif
#ifdef _WIN32
+
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+
+/* Avoid warnings from gcc -Wcast-function-type. */
+# define GetProcAddress \
+ (void *) GetProcAddress
+
/* MEMORYSTATUSEX is missing from older windows headers, so define
a local replacement. */
typedef struct
DWORDLONG ullAvailExtendedVirtual;
} lMEMORYSTATUSEX;
typedef WINBOOL (WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*);
+
#endif
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
of SOCKETs, not bit masks of FDs. */
# undef select
+/* Avoid warnings from gcc -Wcast-function-type. */
+# define GetProcAddress \
+ (void *) GetProcAddress
+
static BOOL IsConsoleHandle (HANDLE h)
{
DWORD mode;
#undef select
+/* Avoid warnings from gcc -Wcast-function-type. */
+#define GetProcAddress \
+ (void *) GetProcAddress
+
struct bitset {
unsigned char in[FD_SETSIZE / CHAR_BIT];
unsigned char out[FD_SETSIZE / CHAR_BIT];
#include "pathmax.h"
#include "verify.h"
+/* Avoid warnings from gcc -Wcast-function-type. */
+#define GetProcAddress \
+ (void *) GetProcAddress
+
#if _GL_WINDOWS_STAT_INODES == 2
/* GetFileInformationByHandleEx was introduced only in Windows Vista. */
typedef DWORD (WINAPI * GetFileInformationByHandleExFuncType) (HANDLE hFile,