C compilation fixes and hardening

Fix "implicit declaration of function ‘strlen’" in ipa_pwd_ntlm.c,
credits to Lukas.

Add -Werror=implicit-function-declaration to CFLAGS to point developers
to missing includes. It causes compilation to fail when a developer
forgets to add a required include. The problem is no longer hidden in a
massive wall of text from make.

Silence a harmless error from 389-DS slapi.h until the bug is fixed in
downstream, https://pagure.io/389-ds-base/issue/48979

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Christian Heimes 2017-02-24 08:20:15 +01:00 committed by Martin Basti
parent 5ab85b365a
commit 2828a2b92b
2 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,9 @@ LT_INIT
AC_HEADER_STDC AC_HEADER_STDC
dnl fail hard when includes statements are missing
CFLAGS+=" -Werror=implicit-function-declaration"
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
AC_ARG_ENABLE([server], AC_ARG_ENABLE([server],

View File

@ -26,6 +26,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h>
#include <iconv.h> #include <iconv.h>
#include <openssl/md4.h> #include <openssl/md4.h>