]> The Tcpdump Group git mirrors - libpcap/commitdiff
Fix compiler warnings on MSYS2/Cygwin 897/head
authorOrgad Shaneh <[email protected]>
Mon, 6 Jan 2020 20:56:32 +0000 (22:56 +0200)
committerOrgad Shaneh <[email protected]>
Tue, 7 Jan 2020 08:45:45 +0000 (10:45 +0200)
/f/Projects/libpcap/fmtutils.c:114:20: warning: initialization of ื’\80\98char *ื’\80\99 from ื’\80\98intื’\80\99 makes pointer from integer without a cast [-Wint-conversion]
  114 |  char *errstring = strerror_r(errnum, strerror_buf, PCAP_ERRBUF_SIZE);
      |                    ^~~~~~~~~~

CMake executes the test for strerror_r with GNU_SOURCE defined,
but the actual application did not define it.

ftmacros.h

index cd3daebdf175e25974c04f1fa91dfc7e70ea26f8..bb08a11a2b871a11768d113d239013fefd345245 100644 (file)
@@ -83,7 +83,7 @@
    * least with HP's C compiler; hopefully doing so won't make it
    * *not* work with *un*-threaded code.
    */
-#elif defined(__linux__) || defined(linux) || defined(__linux)
+#elif defined(__linux__) || defined(linux) || defined(__linux) || defined(__CYGWIN__)
   /*
    * Turn on _GNU_SOURCE to get everything GNU libc has to offer,
    * including asprintf().