Module Name:    src
Committed By:   lukem
Date:           Sat Jul  4 03:08:20 UTC 2020

Modified Files:
        src/usr.bin/make: var.c

Log Message:
make: fix sign-compare warning

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


To generate a diff of this commit:
cvs rdiff -u -r1.246 -r1.247 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.246 src/usr.bin/make/var.c:1.247
--- src/usr.bin/make/var.c:1.246	Fri Jul  3 22:40:55 2020
+++ src/usr.bin/make/var.c	Sat Jul  4 03:08:20 2020
@@ -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 @@ VarRoot(GNode *ctx MAKE_ATTR_UNUSED, Var
 	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);

Reply via email to