Skip to content

Commit 5f26eaf

Browse files
ffontainethiagomacieira
authored andcommitted
Makefile: add DISABLE_WERROR
Allow the user to disable -Werror to avoid the following build failure with gcc 4.8 raised since version 0.6.0 and e2a4ed1: /home/buildroot/autobuild/instance-1/output-1/host/bin/arm-none-linux-gnueabi-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I./src -std=gnu99 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -Werror=incompatible-pointer-types -Werror=implicit-function-declaration -Werror=int-conversion -fPIC -c -o src/cborerrorstrings.pic.o src/cborerrorstrings.c cc1: error: -Werror=incompatible-pointer-types: no option -Wincompatible-pointer-types cc1: error: -Werror=int-conversion: no option -Wint-conversion Fixes: - http://autobuild.buildroot.org/results/a9f/a9fe64c42bb96f9e7b4af3050464f6570c1c00fa Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 6176e0a commit 5f26eaf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,15 @@ tag: distcheck
236236
.SECONDARY:
237237

238238
cflags := $(CPPFLAGS) -I$(SRCDIR)src
239-
cflags += -std=gnu99 $(CFLAGS) \
239+
cflags += -std=gnu99 $(CFLAGS)
240+
241+
ifneq ($(DISABLE_WERROR),1)
242+
cflags += \
240243
-Werror=incompatible-pointer-types \
241244
-Werror=implicit-function-declaration \
242245
-Werror=int-conversion
246+
endif
247+
243248
%.o: %.c
244249
@test -d $(@D) || $(MKDIR) $(@D)
245250
$(CC) $(cflags) $($(basename $(notdir $@))_CCFLAGS) -c -o $@ $<

0 commit comments

Comments
 (0)