Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2017 05:18:18 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r312120 - head/tests/sys/mac/bsdextended
Message-ID:  <201701140518.v0E5IIj6072225@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sat Jan 14 05:18:18 2017
New Revision: 312120
URL: https://svnweb.freebsd.org/changeset/base/312120

Log:
  Fix warnings
  
  - Staticize test_num
  - Promote i to size_t to deal with -Wsign-compare issues
  
  Tested with:	clang, gcc, gcc49
  MFC after:	1 week
  Sponsored by:	Dell EMC Isilon

Modified:
  head/tests/sys/mac/bsdextended/ugidfw_test.c

Modified: head/tests/sys/mac/bsdextended/ugidfw_test.c
==============================================================================
--- head/tests/sys/mac/bsdextended/ugidfw_test.c	Sat Jan 14 05:06:14 2017	(r312119)
+++ head/tests/sys/mac/bsdextended/ugidfw_test.c	Sat Jan 14 05:18:18 2017	(r312120)
@@ -71,7 +71,7 @@ static const char *test_groups[] = {
 	"bin",
 };
 
-int test_num;
+static int test_num;
 
 /*
  * List of test strings that must go in (and come out) of libugidfw intact.
@@ -149,7 +149,8 @@ test_libugidfw_strings(void)
 	struct mac_bsdextended_rule rule;
 	char errorstr[256];
 	char rulestr[256];
-	int error, i;
+	size_t i;
+	int error;
 
 	for (i = 0; i < nitems(test_users); i++, test_num++) {
 		if (getpwnam(test_users[i]) == NULL)
@@ -171,7 +172,7 @@ test_libugidfw_strings(void)
 		error = bsde_parse_rule_string(test_strings[i], &rule,
 		    sizeof(errorstr), errorstr);
 		if (error == -1)
-			printf("not ok %d # bsde_parse_rule_string: '%s' (%d) "
+			printf("not ok %d # bsde_parse_rule_string: '%s' (%zu) "
 			    "failed: %s\n", test_num, test_strings[i], i, errorstr);
 		else
 			printf("ok %d\n", test_num);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701140518.v0E5IIj6072225>