aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Mayer <jmayer@loplof.de>2018-03-28 15:34:28 -0700
committerGuy Harris <guy@alum.mit.edu>2018-03-28 15:34:28 -0700
commited233903fced76d69f63f5a585b5919dd9ff4310 (patch)
tree2fe5253cae802b61954b43ee133978eed8476f7a
parentc6fde3d1975ecda5563c39712ff389e78e50b895 (diff)
Add -Wcovered-switch-default in a comment.
Do NOT add it by default. as the warnings are genuine but intended Make the rpcapd/log-stderr.c error case identical to the gencode.c case. Signed-off-by: Joerg Mayer <jmayer@loplof.de>
-rw-r--r--CMakeLists.txt2
-rw-r--r--aclocal.m43
-rwxr-xr-xconfigure3
-rw-r--r--rpcapd/log-stderr.c3
4 files changed, 10 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 16211ac4..cdfaa4bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1672,6 +1672,8 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel)
check_and_add_compiler_option(-Wdocumentation)
check_and_add_compiler_option(-Wcomma)
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)
endif()
endif()
diff --git a/aclocal.m4 b/aclocal.m4
index f4dd40ca..a2ee7bb7 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -850,6 +850,9 @@ AC_DEFUN(AC_LBL_DEVEL,
AC_LBL_CHECK_COMPILER_OPT($1, -Wdocumentation)
AC_LBL_CHECK_COMPILER_OPT($1, -Wcomma)
AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-noreturn)
+ # Warns about safeguards added in case the enums are
+ # extended
+ # AC_LBL_CHECK_COMPILER_OPT($1, -Wcovered-switch-default)
fi
AC_LBL_CHECK_DEPENDENCY_GENERATION_OPT()
#
diff --git a/configure b/configure
index 1eb5ad35..3370a31f 100755
--- a/configure
+++ b/configure
@@ -8822,6 +8822,9 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ # Warns about safeguards added in case the enums are
+ # extended
+ # AC_LBL_CHECK_COMPILER_OPT(V_CCOPT, -Wcovered-switch-default)
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports generating dependencies" >&5
diff --git a/rpcapd/log-stderr.c b/rpcapd/log-stderr.c
index d5054b3b..4fce0ece 100644
--- a/rpcapd/log-stderr.c
+++ b/rpcapd/log-stderr.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdarg.h>
+#include <stdlib.h>
#include "log.h"
void
@@ -28,7 +29,7 @@ rpcapd_log(log_priority priority, const char *message, ...)
break;
default:
- /* Don't do this. */
+ abort();
return;
}