From 16d3ffa15906037863110f4157ab84e13f579752 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 27 Nov 2019 20:28:09 +0100 Subject: w32: Fix bad-function-cast warning. * src/w32-fd-t.inc.h (assuan_fd_from_posix_fd): Avoid compiler warning. -- The actual warning was: warning: cast from function call of type 'intptr_t' {aka 'int'} to non-matching type 'void *' [-Wbad-function-cast] return (assuan_fd_t)(HANDLE) _get_osfhandle (fd); Signed-off-by: Werner Koch --- src/w32-fd-t.inc.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/w32-fd-t.inc.h b/src/w32-fd-t.inc.h index ca63671..bc3df28 100644 --- a/src/w32-fd-t.inc.h +++ b/src/w32-fd-t.inc.h @@ -28,6 +28,10 @@ typedef void *assuan_fd_t; #define ASSUAN_INVALID_FD ((void*)(-1)) #define ASSUAN_INVALID_PID ((pid_t) -1) +#if GPGRT_HAVE_PRAGMA_GCC_PUSH +# pragma GCC push_options +# pragma GCC diagnostic ignored "-Wbad-function-cast" +#endif static GPG_ERR_INLINE assuan_fd_t assuan_fd_from_posix_fd (int fd) { @@ -36,5 +40,8 @@ assuan_fd_from_posix_fd (int fd) else return (assuan_fd_t) _get_osfhandle (fd); } +#if GPGRT_HAVE_PRAGMA_GCC_PUSH +# pragma GCC pop_options +#endif ##EOF## -- cgit v1.2.3