diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-12-17 23:12:11 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2016-12-28 22:31:28 +0000 |
commit | 31872655ad257cadbf8805d0e94c0bae9696a746 (patch) | |
tree | 8eb6ee186dc20a2cad27f31849a71c113503459f /acinclude.m4 | |
parent | 52d38a18fdfc8f2b0903721e007b8f62d53e5759 (diff) | |
download | wireshark-31872655ad257cadbf8805d0e94c0bae9696a746.tar.gz |
CMake,autotools: enable -Werror=implicit by default
The -Wimplicit error covers two warnings, trying to catch these cases:
Setting a global variable without declaring its type (-Wimplicit-int):
undeclared_type = 1;
More importantly, -Wimplicit-function-declaration catches the case where
a function is not declared (missing header, programming error, etc.).
Turn these warnings into errors, most likely it will be a programming
error that results in a link failure anyway. See also
https://fedoraproject.org/wiki/Changes/Fedora26CFlags
Also fix autotools checks not to trigger -Wimplicit-int and
-Wimplicit-function-declaration (in krb5 check due to missing include).
Tested on Ubuntu 16.04 (autotools & cmake) and Arch Linux (cmake),
configure/cmake output and config.h are identical.
Change-Id: I137284263f3b1223df6e6a893111c3640802631f
Reviewed-on: https://code.wireshark.org/review/19331
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 9 |
1 files changed, 5 insertions, 4 deletions
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) |