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)
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>

No differences found