aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt7
-rw-r--r--acinclude.m49
-rw-r--r--configure.ac7
3 files changed, 19 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ef6af58dc4..5aaedbf7de 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -429,6 +429,13 @@ else()
# The Qt headers generate a ton of shortening errors on 64-bit systems
# so only enable this for C for now.
-Wshorten-64-to-32
+
+ #
+ # Implicit function declarations are an error in C++ and most
+ # likely a programming error in C. Turn -Wimplicit-int and
+ # -Wimplicit-function-declaration into an error by default.
+ #
+ -Werror=implicit
)
set(CXX_WARN_FLAGS
diff --git a/acinclude.m4 b/acinclude.m4
index 97d3f8aaa4..ee172ef470 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -376,7 +376,7 @@ install a newer version of the header file.])
AC_LANG_SOURCE(
[[
#include <pcap.h>
- main()
+ int main()
{
pcap_if_t *devpointer;
char errbuf[1];
@@ -979,9 +979,10 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
fi
AC_TRY_LINK(
[
+# include <krb5.h>
],
[
- krb5_kt_resolve();
+ krb5_kt_resolve(0, 0, 0);
],
[
#
@@ -1043,7 +1044,7 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
#include <krb5.h>
#include <stdio.h>
- main()
+ int main()
{
printf("%u\n", KEYTYPE_ARCFOUR_56);
}
@@ -1213,7 +1214,7 @@ LDFLAGS="$LDFLAGS $LD_OPTION"
can_add_to_ldflags=""
AC_LINK_IFELSE(
[
- AC_LANG_SOURCE([[main() { return; }]])
+ AC_LANG_SOURCE([[int main() { return 0; }]])
],
[
AC_MSG_RESULT(yes)
diff --git a/configure.ac b/configure.ac
index 13ed6076f0..697b6c0c04 100644
--- a/configure.ac
+++ b/configure.ac
@@ -657,6 +657,13 @@ AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wjump-misses-init, C)
# so only enable this for C for now.
AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wshorten-64-to-32, C)
+#
+# Implicit function declarations are an error in C++ and most
+# likely a programming error in C. Turn -Wimplicit-int and
+# -Wimplicit-function-declaration into an error by default.
+#
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Werror=implicit, C)
+
# Clang only. Avoid "argument unused during compilation" warnings
# (for example, when getting the -gsplit-dwarf option or
# when combining -fwrapv with -fno-strict-overflow)