Hi Jesse,
Spinning up a new server to convert tradspool to CNFS and notice the following
compile time warning when building INN 2.7.1. I do not recall seeing this when
building 2.7.0 (but it's been awhile).
Warning exhibited:
cnfs/cnfs.c:814:13: warning: 'strncpy' specified bound 16 equals destination size [-Wstringop-truncation]
814 | strncpy(cycbuff->metaname, metacycbuff->name, CNFSNASIZ);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This specific warning should have been ignored, and not triggered by
your gcc 12.2.0. At least, there is no reason why it was not seen in
INN 2.7.0, which similarly has it ignored. (Unless of course __GNUC__
is no longer set in this version from FreeBSD.)
#if __GNUC__ > 7
# pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
/* Don't use sprintf() or strlcat() directly...
* The terminating '\0' causes grief. */
strncpy(cycbuff->metaname, metacycbuff->name, CNFSNASIZ);
The code works fine so you should not worry about it.
There are some diagnostics ignored sometimes in the source code, but
that's OK. (A rewrite of such parts of code is welcome of course to get
rid of the warning. In this case, probably switching to use memcpy().)
--
Julien ÉLIE
« Il n'y a que le premier pas qui coûte. » (Mme du Deffand)
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)