Source-Changes-HG archive

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

[src/trunk]: src/sbin/newfs_ext2fs Avoid non-literal format string. Raise WAR...



details:   https://anonhg.NetBSD.org/src/rev/a8f84ee1f4cc
branches:  trunk
changeset: 778392:a8f84ee1f4cc
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sat Mar 24 08:22:24 2012 +0000

description:
Avoid non-literal format string. Raise WARNS to 4 and disable
sign warnings instead.

diffstat:

 sbin/newfs_ext2fs/Makefile |  6 ++++--
 sbin/newfs_ext2fs/mke2fs.c |  6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 8dd158641f4f -r a8f84ee1f4cc sbin/newfs_ext2fs/Makefile
--- a/sbin/newfs_ext2fs/Makefile        Sat Mar 24 07:03:12 2012 +0000
+++ b/sbin/newfs_ext2fs/Makefile        Sat Mar 24 08:22:24 2012 +0000
@@ -1,7 +1,9 @@
-#      $NetBSD: Makefile,v 1.3 2009/06/05 21:52:31 haad Exp $
+#      $NetBSD: Makefile,v 1.4 2012/03/24 08:22:24 joerg Exp $
 #      @(#)Makefile    8.2 (Berkeley) 3/27/94
 
-WARNS?=        3       # XXX: sign-compare issues
+WARNS?=        4
+
+CWARNFLAGS+=   -Wno-sign-compare
 
 .include <bsd.own.mk>
 
diff -r 8dd158641f4f -r a8f84ee1f4cc sbin/newfs_ext2fs/mke2fs.c
--- a/sbin/newfs_ext2fs/mke2fs.c        Sat Mar 24 07:03:12 2012 +0000
+++ b/sbin/newfs_ext2fs/mke2fs.c        Sat Mar 24 08:22:24 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mke2fs.c,v 1.15 2012/03/06 15:39:41 tsutsui Exp $      */
+/*     $NetBSD: mke2fs.c,v 1.16 2012/03/24 08:22:24 joerg Exp $        */
 
 /*-
  * Copyright (c) 2007 Izumi Tsutsui.  All rights reserved.
@@ -100,7 +100,7 @@
 #if 0
 static char sccsid[] = "@(#)mkfs.c     8.11 (Berkeley) 5/3/95";
 #else
-__RCSID("$NetBSD: mke2fs.c,v 1.15 2012/03/06 15:39:41 tsutsui Exp $");
+__RCSID("$NetBSD: mke2fs.c,v 1.16 2012/03/24 08:22:24 joerg Exp $");
 #endif
 #endif /* not lint */
 
@@ -626,7 +626,7 @@
                        continue;
                }
                /* Print superblock numbers */
-               len = printf(" %*" PRIu64 "," + !col, fld_width,
+               len = printf("%s%*" PRIu64 ",", (col ? " " : ""), fld_width,
                    (uint64_t)cgbase(&sblock, cylno));
                col += len;
                if (col + len < max_cols)



Home | Main Index | Thread Index | Old Index