chiark / gitweb /
build system: Add warning suppressions for GCC9
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 19 Nov 2019 00:42:31 +0000 (00:42 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 19 Nov 2019 20:41:40 +0000 (20:41 +0000)
commit670b3e8fb59ae977e4b1a36442e0f2c9836be6de
tree2542951da67d2857da66ada88c71b9c3b7bf854d
parent611404b83e10fb82a62c7649f5800ae294dedb1e
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 <ijackson@chiark.greenend.org.uk>
common.make.in