From e22fb91e3145ab95e44c2ad291b330ae79847893 Mon Sep 17 00:00:00 2001 From: Harry Liebel Date: Fri, 3 Jan 2014 14:18:15 +0000 Subject: [PATCH] Build project with 'pedantic' Tighten up ISO C standard checking. Fix 'CASSERT' implementation to conform to C99 as opposed to GNU99 standard. Change-Id: I58ddc61913617b66f11da5b6e3f7363136d5cf7d --- Makefile | 4 ++-- include/bl_common.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d3951ead..75a40222 100644 --- a/Makefile +++ b/Makefile @@ -98,8 +98,8 @@ INCLUDES += -Ilib/include/ -Iinclude/aarch64/ -Iinclude/ \ ASFLAGS += -nostdinc -ffreestanding -Wa,--fatal-warnings \ -D__ASSEMBLY__ ${INCLUDES} -CFLAGS := -nostdinc -ffreestanding -Wall -Werror -std=c99 -c -Os \ - -DDEBUG=${DEBUG} ${INCLUDES} ${CFLAGS} +CFLAGS := -nostdinc -pedantic -ffreestanding -Wall -Werror \ + -std=c99 -c -Os -DDEBUG=${DEBUG} ${INCLUDES} ${CFLAGS} LDFLAGS += --fatal-warnings -O1 BL1_LDFLAGS := -Map=${BL1_MAPFILE} --script ${BL1_LINKERFILE} --entry=${BL1_ENTRY_POINT} diff --git a/include/bl_common.h b/include/bl_common.h index 995b5e6c..7912ab6f 100644 --- a/include/bl_common.h +++ b/include/bl_common.h @@ -69,7 +69,7 @@ * The following compilation error is triggered if the assertion fails: * "error: size of array 'msg' is negative" ******************************************************************************/ -#define CASSERT(cond, msg) typedef char msg[(cond) ? 0 : -1] +#define CASSERT(cond, msg) typedef char msg[(cond) ? 1 : -1] /****************************************************************************** * Opcode passed in x0 to tell next EL that we want to run an image. -- 2.30.2