gcc: newer gcc trip on -Wstringop-truncation for valid uses of strncpy()
strncpy() is correctly used to fill in a zero-*padded* (not zero-terminated) field in several places. Make gcc not complain about those uses. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
3cb9068ee0
commit
c4e16f7e7c
1 changed files with 3 additions and 0 deletions
|
@ -278,6 +278,9 @@ dnl Suppress format warning on Windows targets due to their <inttypes.h>
|
|||
PA_ADD_CFLAGS([-Wpedantic-ms-format],[-Wno-pedantic-ms-format])
|
||||
PA_ADD_CFLAGS([-Wc90-c99-compat])
|
||||
PA_ADD_CFLAGS([-Wlong-long],[-Wno-long-long])
|
||||
dnl This is needed because we intentionally expect strncpy() to fill
|
||||
dnl in a zero-padded (not zero-terminated) buffer in several backends
|
||||
PA_ADD_CFLAGS([-Wstringop-truncation],[-Wno-stringop-truncation])
|
||||
dnl PA_ADD_CFLAGS([-Wwrite-strings])
|
||||
PA_ARG_ENABLED([werror],
|
||||
[compile with -Werror to error out on any warning],
|
||||
|
|
Loading…
Reference in a new issue