From: Ian Jackson Date: Tue, 19 Nov 2019 00:42:31 +0000 (+0000) Subject: build system: Add warning suppressions for GCC9 X-Git-Tag: v0.5.1~9 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=commitdiff_plain;h=670b3e8fb59ae977e4b1a36442e0f2c9836be6de build system: Add warning suppressions for GCC9 We suppress 4 instances like: udp.c:113:45: error: increment of a boolean expression [-Werror=bool-operation] 113 | if (us->experienced[!!dest][af][success]++) | ^~ This is a very convenient idiom (using the saturating property of boolean addition) and there is no sensible replacement. And we suppress 6 instances like: tun.c:322:6: error: 'strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation] 322 | strncpy(ifr.ifr_name,st->interface_name,IFNAMSIZ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All write to ifr_name. strncpy is precisely right for this, since the API supports non-null-terminated names of length IFNAMSIZ. That is why I used strncpy. Signed-off-by: Ian Jackson --- diff --git a/common.make.in b/common.make.in index b772704..7c073b1 100644 --- a/common.make.in +++ b/common.make.in @@ -31,4 +31,5 @@ CFLAGS:=-Wall @WRITESTRINGS@ @CFLAGS@ -Werror \ -Wmissing-declarations -Wnested-externs -Wredundant-decls \ -Wpointer-arith -Wformat=2 -Winit-self \ -Wswitch-enum -Wunused-variable -Wunused-function -Wbad-function-cast \ - -Wno-strict-aliasing -fno-strict-aliasing + -Wno-strict-aliasing -fno-strict-aliasing \ + -Wno-bool-operation -Wno-stringop-truncation