From: Daniel Stenberg Date: Fri, 23 Feb 2018 22:35:23 +0000 (+0100) Subject: build: get CFLAGS (including -werror) used for examples and tests X-Git-Tag: curl-7_59_0~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b0b1a30881590e70082784e16f3c2c66d88b218;p=thirdparty%2Fcurl.git build: get CFLAGS (including -werror) used for examples and tests ... so that the CI and more detects compiler warnings/errors properly! Closes #2337 --- diff --git a/docs/examples/Makefile.am b/docs/examples/Makefile.am index afd35c20be..e5ed222ef1 100644 --- a/docs/examples/Makefile.am +++ b/docs/examples/Makefile.am @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -53,6 +53,9 @@ else LDADD = $(LIBDIR)/libcurl.la endif +# This might hold -Werror +CFLAGS += @CURL_CFLAG_EXTRAS@ + # Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines include Makefile.inc diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am index a4e85ef0c2..0b8ebe9a93 100644 --- a/tests/libtest/Makefile.am +++ b/tests/libtest/Makefile.am @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -49,6 +49,8 @@ test1022.pl Makefile.inc notexists.pl CMakeLists.txt mk-lib1521.pl CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ +CFLAGS += @CURL_CFLAG_EXTRAS@ + # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) diff --git a/tests/libtest/lib655.c b/tests/libtest/lib655.c index f871915984..8777b99edf 100644 --- a/tests/libtest/lib655.c +++ b/tests/libtest/lib655.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -23,7 +23,7 @@ #include "memdebug.h" -static const char TEST_DATA_STRING[] = "Test data"; +static const char *TEST_DATA_STRING = "Test data"; static int cb_count = 0; static int diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 61b72c0db3..fab82d2b06 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -50,6 +50,8 @@ endif EXTRA_DIST = Makefile.inc CMakeLists.txt +CFLAGS += @CURL_CFLAG_EXTRAS@ + # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) diff --git a/tests/unit/unit1607.c b/tests/unit/unit1607.c index 135030cac6..71c59939b1 100644 --- a/tests/unit/unit1607.c +++ b/tests/unit/unit1607.c @@ -28,7 +28,7 @@ #include "memdebug.h" /* LAST include file */ static struct Curl_easy *easy; -struct curl_hash *hostcache; +static struct curl_hash *hostcache; static void unit_stop(void) {