mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-06 16:40:47 +00:00
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
This commit is contained in:
parent
c794d18822
commit
69c8025a49
|
@ -46,3 +46,7 @@ file1:
|
|||
@echo "File 1" > ${.TARGET}
|
||||
|
||||
.include <bsd.test.mk>
|
||||
|
||||
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000
|
||||
CWARNFLAGS.printf_test.c+= -Wno-format-truncation
|
||||
.endif
|
||||
|
|
|
@ -46,3 +46,7 @@ file1:
|
|||
@echo "File 1" > ${.TARGET}
|
||||
|
||||
.include <bsd.test.mk>
|
||||
|
||||
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000
|
||||
CWARNFLAGS.printf_test.c+= -Wno-format-truncation
|
||||
.endif
|
||||
|
|
|
@ -46,3 +46,7 @@ file1:
|
|||
@echo "File 1" > ${.TARGET}
|
||||
|
||||
.include <bsd.test.mk>
|
||||
|
||||
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000
|
||||
CWARNFLAGS.printf_test.c+= -Wno-format-truncation
|
||||
.endif
|
||||
|
|
Loading…
Reference in a new issue