forcibly kill bogus warning

pull/797/head
Brad House 8 months ago
parent 1b8cfdedc9
commit 381d38d925
  1. 24
      src/lib/ares_event_win32.c
  2. 11
      src/lib/ares_sysconfig_mac.c

@ -25,7 +25,7 @@
*/
/* Uses an anonymous union */
#if defined(__GNUC__)
#if defined(__clang__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wc11-extensions"
#endif
@ -260,11 +260,27 @@ static ares_bool_t ares_evsys_win32_init(ares_event_thread_t *e)
goto fail;
}
#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
/* Without the (void *) cast we get:
* warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'NTSTATUS (*)(...)'} [-Wcast-function-type]
* but with it we get:
* warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
* look unsolvable short of killing the warning.
*/
#endif
/* Load Internal symbols not typically accessible */
ew->NtDeviceIoControlFile = (NtDeviceIoControlFile_t)GetProcAddress(
ew->NtDeviceIoControlFile = (NtDeviceIoControlFile_t)(void *)GetProcAddress(
ntdll, "NtDeviceIoControlFile");
ew->NtCancelIoFileEx =
(NtCancelIoFileEx_t)GetProcAddress(ntdll, "NtCancelIoFileEx");
(NtCancelIoFileEx_t)(void *)GetProcAddress(ntdll, "NtCancelIoFileEx");
#ifdef __GNUC__
# pragma GCC diagnostic pop
#endif
if (ew->NtCancelIoFileEx == NULL || ew->NtDeviceIoControlFile == NULL) {
goto fail;
@ -597,6 +613,6 @@ const ares_event_sys_t ares_evsys_win32 = { "win32",
ares_evsys_win32_wait };
#endif
#if defined(__GNUC__)
#if defined(__clang__)
# pragma GCC diagnostic pop
#endif

@ -47,8 +47,10 @@
*/
/* The apple header uses anonymous unions which came with C11 */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wc11-extensions"
# if defined(__clang__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wc11-extensions"
# endif
# include "ares_setup.h"
# include <stdio.h>
@ -370,7 +372,10 @@ done:
}
return status;
}
#pragma GCC diagnostic pop
# if defined(__clang__)
# pragma GCC diagnostic pop
# endif
#else

Loading…
Cancel
Save