Hello, attache are four tiny patches to current git head of libpcap:
0001-Fix-warning-from-Wshadow.patch 0002-Fix-warnnigs-from-Wdocumentation.patch 0003-Allow-.devel-file-to-be-in-the-build-directory-in-ad.patch 0004-Add-Wdocumentation-to-development-warnings.patch Patch 4 is kind of "unclean" as it still generates warnings in the generated file scanner.c on my system (current macos with current xcode). Please apply at least patches 1-3 (or some varation thereof). Thanks Jörg -- Joerg Mayer <jma...@loplof.de> We are stuck with technology when what we really want is just stuff that works. Some say that should read Microsoft instead of technology.
>From 36cde69317b699d7247eca6558bcc2c6abd23e50 Mon Sep 17 00:00:00 2001 From: Joerg Mayer <jma...@loplof.de> Date: Mon, 26 Mar 2018 13:21:59 +0200 Subject: [PATCH 1/4] Fix warning from -Wshadow Signed-off-by: Joerg Mayer <jma...@loplof.de> --- rpcapd/rpcapd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rpcapd/rpcapd.c b/rpcapd/rpcapd.c index d3594081..53554250 100755 --- a/rpcapd/rpcapd.c +++ b/rpcapd/rpcapd.c @@ -564,13 +564,13 @@ main_passive(void *ptr) SOCKET sockctrl; // keeps the socket ID for this control connection struct sockaddr_storage from; // generic sockaddr_storage variable socklen_t fromlen; // keeps the length of the sockaddr_storage variable - SOCKET sockmain; + SOCKET sockmaincopy; #ifndef _WIN32 pid_t pid; #endif - sockmain = *((SOCKET *) ptr); + sockmaincopy = *((SOCKET *) ptr); // Delete the pointer (which has been allocated in the main) free(ptr); @@ -589,7 +589,7 @@ main_passive(void *ptr) // Connection creation fromlen = sizeof(struct sockaddr_storage); - sockctrl = accept(sockmain, (struct sockaddr *) &from, &fromlen); + sockctrl = accept(sockmaincopy, (struct sockaddr *) &from, &fromlen); if (sockctrl == INVALID_SOCKET) { @@ -665,7 +665,7 @@ main_passive(void *ptr) pars->nullAuthAllowed = nullAuthAllowed; // Close the main socket (must be open only in the parent) - closesocket(sockmain); + closesocket(sockmaincopy); daemon_serviceloop((void *) pars); exit(0); -- 2.14.3 (Apple Git-98)
>From 6696a7635a1cd803d485e2a95766b58bc6314461 Mon Sep 17 00:00:00 2001 From: Joerg Mayer <jma...@loplof.de> Date: Mon, 26 Mar 2018 13:22:35 +0200 Subject: [PATCH 2/4] Fix warnnigs from -Wdocumentation Signed-off-by: Joerg Mayer <jma...@loplof.de> --- rpcapd/daemon.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rpcapd/daemon.c b/rpcapd/daemon.c index fe8d75dd..e2d89d96 100755 --- a/rpcapd/daemon.c +++ b/rpcapd/daemon.c @@ -2361,14 +2361,12 @@ error: that can be used to be sent on the network. Basically, it applies all the hton() conversion required to the input variable. - \param sockaddrin: a 'sockaddr_storage' pointer to the variable that has to be + \param sockaddrin a 'sockaddr_storage' pointer to the variable that has to be serialized. This variable can be both a 'sockaddr_in' and 'sockaddr_in6'. - \param sockaddrout: an 'rpcap_sockaddr' pointer to the variable that will contain + \param sockaddrout an 'rpcap_sockaddr' pointer to the variable that will contain the serialized data. This variable has to be allocated by the user. - \return None - \warning This function supports only AF_INET and AF_INET6 address families. */ static void -- 2.14.3 (Apple Git-98)
>From 880fc2d6016c6bf9041e6480f899e1cc4cf6e019 Mon Sep 17 00:00:00 2001 From: Joerg Mayer <jma...@loplof.de> Date: Mon, 26 Mar 2018 13:23:51 +0200 Subject: [PATCH 3/4] Allow .devel file to be in the build directory in addition to the source tree. Signed-off-by: Joerg Mayer <jma...@loplof.de> --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de985e09..fa429cba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1555,7 +1555,7 @@ macro(check_and_add_compiler_option _option) endmacro() set(C_ADDITIONAL_FLAGS "") -if(EXISTS ${CMAKE_SOURCE_DIR}/.devel) +if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel) # # Warning options. # -- 2.14.3 (Apple Git-98)
>From 4c95dad018faea2b7184f72d3e48c0610b88c451 Mon Sep 17 00:00:00 2001 From: Joerg Mayer <jma...@loplof.de> Date: Mon, 26 Mar 2018 13:25:27 +0200 Subject: [PATCH 4/4] Add -Wdocumentation to development warnings Signed-off-by: Joerg Mayer <jma...@loplof.de> --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa429cba..c69674f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1626,6 +1626,7 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel) check_and_add_compiler_option(-Wshadow) check_and_add_compiler_option(-Wdeclaration-after-statement) check_and_add_compiler_option(-Wused-but-marked-unused) + check_and_add_compiler_option(-Wdocumentation) endif() endif() -- 2.14.3 (Apple Git-98)
_______________________________________________ tcpdump-workers mailing list tcpdump-workers@lists.tcpdump.org https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers