From 93a3c7f663327fbc835b464596e23d86f8135b6a Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Mon, 4 Feb 2013 09:49:57 +0200 Subject: [PATCH] Enable gcc specific flags in tests correctly ... and fix issues found. --- Makefile.am | 5 +++++ src/Makefile.am | 5 ----- test/bin/Makefile.am | 1 - test/bin/json_process.c | 2 +- test/suites/api/Makefile.am | 1 - test/suites/api/test_array.c | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Makefile.am b/Makefile.am index a40aa46..9306402 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,3 +8,8 @@ dvi: pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = jansson.pc + +if GCC +# These flags are gcc specific +export AM_CFLAGS = -Wall -Wextra -Wdeclaration-after-statement -Werror +endif diff --git a/src/Makefile.am b/src/Makefile.am index 9d040f6..ff76d37 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,8 +22,3 @@ libjansson_la_LDFLAGS = \ -no-undefined \ -export-symbols-regex '^json_' \ -version-info 8:0:4 - -if GCC -# These flags are gcc specific -AM_CFLAGS = -Wall -Wextra -Wdeclaration-after-statement -Werror -endif diff --git a/test/bin/Makefile.am b/test/bin/Makefile.am index 478f62b..63b6dce 100644 --- a/test/bin/Makefile.am +++ b/test/bin/Makefile.am @@ -1,6 +1,5 @@ check_PROGRAMS = json_process AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src -AM_CFLAGS = -Wall -Werror LDFLAGS = -static # for speed and Valgrind LDADD = $(top_builddir)/src/libjansson.la diff --git a/test/bin/json_process.c b/test/bin/json_process.c index 40183c7..637dfd5 100644 --- a/test/bin/json_process.c +++ b/test/bin/json_process.c @@ -113,7 +113,7 @@ int main(int argc, char *argv[]) char *buffer = NULL; while(1) { - int count; + size_t count; size = (size == 0 ? 128 : size * 2); buffer = realloc(buffer, size); diff --git a/test/suites/api/Makefile.am b/test/suites/api/Makefile.am index 2b1746d..1dbdd2b 100644 --- a/test/suites/api/Makefile.am +++ b/test/suites/api/Makefile.am @@ -30,6 +30,5 @@ test_simple_SOURCES = test_simple.c util.h test_unpack_SOURCES = test_unpack.c util.h AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src -AM_CFLAGS = -Wall -Werror LDFLAGS = -static # for speed and Valgrind LDADD = $(top_builddir)/src/libjansson.la diff --git a/test/suites/api/test_array.c b/test/suites/api/test_array.c index b20637f..cb273f8 100644 --- a/test/suites/api/test_array.c +++ b/test/suites/api/test_array.c @@ -11,7 +11,7 @@ static void test_misc(void) { json_t *array, *five, *seven, *value; - int i; + size_t i; array = json_array(); five = json_integer(5);