summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2019-11-27 20:28:09 +0100
committerWerner Koch <wk@gnupg.org>2019-11-27 20:28:09 +0100
commit16d3ffa15906037863110f4157ab84e13f579752 (patch)
tree511aa8d2c5e5d1be25c538d3079f445f4181c932
parent2fc0761aedffe661c030b3f1f73e268ca66d34a4 (diff)
downloadlibassuan-16d3ffa15906037863110f4157ab84e13f579752.tar.gz
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 <wk@gnupg.org>
-rw-r--r--src/w32-fd-t.inc.h7
1 files changed, 7 insertions, 0 deletions
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##