]> The Tcpdump Group git mirrors - libpcap/commitdiff
Declare some variables static (found via -Wmissing-variable-declarations) 685/head
authorJoerg Mayer <[email protected]>
Sat, 31 Mar 2018 19:33:40 +0000 (21:33 +0200)
committerJoerg Mayer <[email protected]>
Sun, 1 Apr 2018 17:47:17 +0000 (19:47 +0200)
CMakeLists.txt
aclocal.m4
rpcapd/rpcapd.c

index 23f7036fe73f7cc2571d85c4c5e584510a5f4ced..754f70d013ce55d84d8de1d41346bfe332fa4b9c 100644 (file)
@@ -1674,6 +1674,7 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel)
         check_and_add_compiler_option(-Wmissing-noreturn)
         # Warns about safeguards added in case the enums are extended
         # check_and_add_compiler_option(-Wcovered-switch-default)
+        check_and_add_compiler_option(-Wmissing-variable-declarations)
     endif()
 endif()
 
index a2ee7bb73599530747fa5f90990345e57b04d4b3..d26ce86273c83ab81f5d65c9a323c6fef339a393 100644 (file)
@@ -853,6 +853,7 @@ AC_DEFUN(AC_LBL_DEVEL,
                    # Warns about safeguards added in case the enums are
                    # extended
                    # AC_LBL_CHECK_COMPILER_OPT($1, -Wcovered-switch-default)
+                   AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-variable-declarations)
            fi
            AC_LBL_CHECK_DEPENDENCY_GENERATION_OPT()
            #
index 69cc5aca941f7db5aa43cd6fe1f32054931ba37c..c46e3106963a0e92cf222f7e3b33951b8305803b 100755 (executable)
@@ -70,14 +70,14 @@ struct listen_sock {
 
 // Global variables
 char hostlist[MAX_HOST_LIST + 1];              //!< Keeps the list of the hosts that are allowed to connect to this server
-struct active_pars activelist[MAX_ACTIVE_LIST];                //!< Keeps the list of the hosts (host, port) on which I want to connect to (active mode)
+struct active_pars activelist[MAX_ACTIVE_LIST];        //!< Keeps the list of the hosts (host, port) on which I want to connect to (active mode)
 int nullAuthAllowed;                           //!< '1' if we permit NULL authentication, '0' otherwise
 static struct listen_sock *listen_socks;       //!< sockets on which we listen
 char loadfile[MAX_LINE + 1];                   //!< Name of the file from which we have to load the configuration
-int passivemode = 1;                           //!< '1' if we want to run in passive mode as well
-struct addrinfo mainhints;                     //!< temporary struct to keep settings needed to open the new socket
-char address[MAX_LINE + 1];                    //!< keeps the network address (either numeric or literal) to bind to
-char port[MAX_LINE + 1];                       //!< keeps the network port to bind to
+static int passivemode = 1;                    //!< '1' if we want to run in passive mode as well
+static struct addrinfo mainhints;              //!< temporary struct to keep settings needed to open the new socket
+static char address[MAX_LINE + 1];             //!< keeps the network address (either numeric or literal) to bind to
+static char port[MAX_LINE + 1];                        //!< keeps the network port to bind to
 #ifdef _WIN32
 static HANDLE shutdown_event;                  //!< event to signal to shut down the main loop
 #else