Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make: fix sign-compare warning



details:   https://anonhg.NetBSD.org/src/rev/bf0f2924416e
branches:  trunk
changeset: 973553:bf0f2924416e
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sat Jul 04 03:08:20 2020 +0000

description:
make: fix sign-compare warning

Fix -Wsign-compare warning on amd64, introduced in rev 1.239

diffstat:

 usr.bin/make/var.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 5fb1acb71d61 -r bf0f2924416e usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sat Jul 04 01:20:42 2020 +0000
+++ b/usr.bin/make/var.c        Sat Jul 04 03:08:20 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.246 2020/07/03 22:40:55 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.247 2020/07/04 03:08:20 lukem Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.246 2020/07/03 22:40:55 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.247 2020/07/04 03:08:20 lukem Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.246 2020/07/03 22:40:55 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.247 2020/07/04 03:08:20 lukem Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1242,7 +1242,7 @@
        void *dummy MAKE_ATTR_UNUSED)
 {
     char *dot = strrchr(word, '.');
-    size_t len = dot != NULL ? dot - word : strlen(word);
+    size_t len = dot != NULL ? (size_t)(dot - word) : strlen(word);
 
     if (addSpace && vpstate->varSpace)
        Buf_AddByte(buf, vpstate->varSpace);



Home | Main Index | Thread Index | Old Index