maint: silence GCC-14 on utility source getlimits.c

Seen on GCC 14:
  getlimits.c:73:3: warning: stack-based buffer overflow [CWE-121] \
     [-Wanalyzer-out-of-bounds]
     73 |   sprintf (limit + 1, "%" "ju", (uintmax_t) TYPE##_MAX);     \
        |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... while limit is defined more than large enough.

* find/getlimits.c: Add pragma for GCC version >= 14.
This commit is contained in:
Bernhard Voelker 2025-01-05 21:16:57 +01:00
parent b52c6688ff
commit a465fc58bc

View File

@ -38,6 +38,11 @@
# define MIN(a,b) (a<b?a:b)
#endif
/* Silence GCC 14. */
#if 14 <= __GNUC__
# pragma GCC diagnostic ignored "-Wanalyzer-out-of-bounds"
#endif
/* Add one to the absolute value of the number whose textual
representation is BUF + 1. Do this in-place, in the buffer.
Return a pointer to the result, which is normally BUF + 1, but is