HomeFreeBSD

Silence snprintf truncation warnings in printf_test examples

Description

Silence snprintf truncation warnings in printf_test examples

Building share/examples/tests with clang 18 results in a few warnings
like:

share/examples/tests/tests/plain/printf_test.c:67:6: error: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 17 [-Werror,-Wformat-truncation]
   67 |         if (snprintf(buffer, sizeof(buffer), "0123456789abcdef") != 16)
      |             ^

Since these tests are meant as an example of testing snprintf overflow,
suppress the warnings.

MFC after: 3 days

Details

Provenance
dimAuthored on Dec 21 2023, 10:39 PM
Parents
rGc794d188222a: Fix snprintf truncation in telnet
Branches
Unknown
Tags
Unknown