Enable gcc specific flags in tests correctly

... and fix issues found.
This commit is contained in:
Petri Lehtinen 2013-02-04 09:49:57 +02:00
parent 02beb90db3
commit 93a3c7f663
6 changed files with 7 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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);