From b5dfa6ce92131f803d4d672314c92d7aa6f6e22c Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sat, 6 Apr 2019 08:34:43 +0200 Subject: nettle: include config.h before checking for definitions This makes sure that we don't include the internal backport if compiled with a version of nettle that includes that code. We also exclude nettle/backport from the static analyzer's list as it contains files outside our control (from nettle project). Signed-off-by: Nikos Mavrogiannopoulos --- .gitlab-ci.yml | 2 +- lib/nettle/backport/cfb8.c | 4 ++++ lib/nettle/backport/cmac.c | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 66a9273ded..242b3587d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -281,7 +281,7 @@ static-analyzers.Fedora.x86_64: - scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C lib - scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C libdane - make -j$(nproc) -C src/gl && scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C src - - cppcheck --force -q -Ilib/include -Igl/ -Ilib/ -I. --error-exitcode=1 lib/ -i lib/unistring -i lib/minitasn1 -j$(nproc) $CPPCHECK_OPTIONS + - cppcheck --force -q -Ilib/include -Igl/ -Ilib/ -I. --error-exitcode=1 lib/ -i lib/unistring -i lib/minitasn1 -i lib/nettle/backport -j$(nproc) $CPPCHECK_OPTIONS - cppcheck --force -q -Ilib/include -Igl/ -Ilibdane/ -I. --error-exitcode=1 libdane/ -j$(nproc) $CPPCHECK_OPTIONS after_script: - /bin/true diff --git a/lib/nettle/backport/cfb8.c b/lib/nettle/backport/cfb8.c index 0febf647fd..e9816feb78 100644 --- a/lib/nettle/backport/cfb8.c +++ b/lib/nettle/backport/cfb8.c @@ -37,6 +37,10 @@ * ############################################# */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifndef HAVE_NETTLE_CFB8_ENCRYPT #include "cfb8.h" diff --git a/lib/nettle/backport/cmac.c b/lib/nettle/backport/cmac.c index 0791775cfd..a665f0ea6b 100644 --- a/lib/nettle/backport/cmac.c +++ b/lib/nettle/backport/cmac.c @@ -38,6 +38,10 @@ * ############################################# */ +#ifdef HAVE_CONFIG_H +#include +#endif + #ifndef HAVE_NETTLE_CMAC128_UPDATE #include -- cgit v1.2.1