Module Name:    src
Committed By:   fox
Date:           Sun Jun  7 23:15:53 UTC 2020

Modified Files:
        src/libexec/lfs_cleanerd: Makefile.inc

Log Message:
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@


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/libexec/lfs_cleanerd/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/lfs_cleanerd/Makefile.inc
diff -u src/libexec/lfs_cleanerd/Makefile.inc:1.6 src/libexec/lfs_cleanerd/Makefile.inc:1.7
--- src/libexec/lfs_cleanerd/Makefile.inc:1.6	Sat Jun  8 21:15:29 2013
+++ src/libexec/lfs_cleanerd/Makefile.inc	Sun Jun  7 23:15:53 2020
@@ -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 @@ SRCS+=	bufcache.c vnode.c lfs.c kernelop
 .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

Reply via email to