From ecab77654aa916c6f4f9e04ad4d1efa967868f06 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Wed, 13 Jan 2021 21:44:20 +0100 Subject: [PATCH] ports/unix/check: Ignore error from fail_* macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Usage of fail_if/fail_unless macros with a message results in a warning with the latest version of check (0.15.2+) and GCC. Ignore this specific error (since warnings are treated as errors) for now. Example failure: In file included from ../../../../src/../test/unit/lwip_check.h:7, from ../../../../src/../test/unit/lwip_unittests.c:1: ../../../../src/../test/unit/lwip_unittests.c: In function ‘lwip_check_ensure_no_alloc’: ../../../../src/../test/unit/lwip_unittests.c:55:7: error: too many arguments for format [-Werror=format-extra-args] 55 | "mem heap still has %d bytes allocated", lwip_stats.mem.used); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- contrib/ports/unix/check/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/ports/unix/check/Makefile b/contrib/ports/unix/check/Makefile index 383cfaef..81e22e52 100644 --- a/contrib/ports/unix/check/Makefile +++ b/contrib/ports/unix/check/Makefile @@ -37,6 +37,11 @@ LWIPDIR=../../../../src # The include path to sys_arch.h and lwipopts.h must be first, so this must be before Common.mk CFLAGS=-DLWIP_NOASSERT_ON_ERROR -I/usr/include/check -I$(LWIPDIR)/../test/unit +# Ignore 'too many arguments for format' warnings which happen with GCCs +# from check 0.15.2 on fail_if/fail_unless macros with text. +# See https://github.com/libcheck/check/pull/298/commits/82540c5428d3818b64d +CFLAGS+=-Wno-error=format-extra-args + ifeq (clang,$(findstring clang,$(CC))) # check.h causes 'error: token pasting of ',' and __VA_ARGS__ is a GNU extension' with clang 9.0.0 CFLAGS+=-Wno-gnu-zero-variadic-macro-arguments