Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/lfs_cleanerd libexec/lfs_cleanerd: Suppress -Werror=...



details:   https://anonhg.NetBSD.org/src/rev/eeda4caeb669
branches:  trunk
changeset: 972780:eeda4caeb669
user:      fox <fox%NetBSD.org@localhost>
date:      Sun Jun 07 23:15:53 2020 +0000

description:
libexec/lfs_cleanerd: Suppress -Werror=stringop-truncation error

This logic correctly uses strncpy(3) to fully initialize a fixed-width field, and also ensures
NUL-termination on the next line as other users of the field expect.

Add -Werror=stringop-truncation to prevent build failure, when run with MKSANITIZER=yes.

Error was reported when build.sh was run with MKSANITIZER=yes flag.

Reviewed by: kamil@, riastradh@

diffstat:

 libexec/lfs_cleanerd/Makefile.inc |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (18 lines):

diff -r 08c2c9e45308 -r eeda4caeb669 libexec/lfs_cleanerd/Makefile.inc
--- a/libexec/lfs_cleanerd/Makefile.inc Sun Jun 07 23:15:51 2020 +0000
+++ b/libexec/lfs_cleanerd/Makefile.inc Sun Jun 07 23:15:53 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.6 2013/06/08 21:15:29 dholland Exp $
+#      $NetBSD: Makefile.inc,v 1.7 2020/06/07 23:15:53 fox Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/18/93
 
 WARNS?=3               # XXX: too many sign-compare issues
@@ -11,6 +11,8 @@
 .PATH: ${NETBSDSRCDIR}/sys/ufs/lfs ${NETBSDSRCDIR}/sbin/fsck_lfs       \
        ${NETBSDSRCDIR}/libexec/lfs_cleanerd
 
+COPTS.lfs_cleanerd.c+= ${GCC_NO_STRINGOP_TRUNCATION}
+
 FSCK_LFS= ${NETBSDSRCDIR}/sbin/fsck_lfs
 DPADD+=  ${LIBUTIL}
 LDADD+=  -lutil



Home | Main Index | Thread Index | Old Index