Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jun 2018 23:45:59 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335267 - head/sbin/gvinum
Message-ID:  <201806162345.w5GNjxsi081386@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Sat Jun 16 23:45:59 2018
New Revision: 335267
URL: https://svnweb.freebsd.org/changeset/base/335267

Log:
  gvinum: build with WARNS=6
  
  This also removes an unused and uninitialized variable.
  
  Tested with amd64, arm64, i386, mips

Modified:
  head/sbin/gvinum/Makefile
  head/sbin/gvinum/gvinum.c

Modified: head/sbin/gvinum/Makefile
==============================================================================
--- head/sbin/gvinum/Makefile	Sat Jun 16 23:44:18 2018	(r335266)
+++ head/sbin/gvinum/Makefile	Sat Jun 16 23:45:59 2018	(r335267)
@@ -5,7 +5,6 @@ PROG=	gvinum
 SRCS=	gvinum.c gvinum.h geom_vinum_share.c
 MAN=	gvinum.8
 
-WARNS?=	2
 CFLAGS+=	-I${SRCTOP}/sys -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit
 
 LIBADD=	edit geom

Modified: head/sbin/gvinum/gvinum.c
==============================================================================
--- head/sbin/gvinum/gvinum.c	Sat Jun 16 23:44:18 2018	(r335266)
+++ head/sbin/gvinum/gvinum.c	Sat Jun 16 23:45:59 2018	(r335267)
@@ -94,7 +94,7 @@ static void copy_device(struct gv_drive *, const char 
 int
 main(int argc, char **argv)
 {
-	int line, tokens;
+	int tokens;
 	char buffer[BUFSIZ], *inputline, *token[GV_MAXARGS];
 
 	/* Load the module if necessary. */
@@ -124,7 +124,6 @@ main(int argc, char **argv)
 				add_history(inputline);
 				strcpy(buffer, inputline);
 				free(inputline);
-				line++;		    /* count the lines */
 				tokens = gv_tokenize(buffer, token, GV_MAXARGS);
 				if (tokens)
 					parseline(tokens, token);
@@ -184,7 +183,8 @@ gvinum_create(int argc, char * const *argv)
 	int drives, errors, fd, flags, i, line, plexes, plex_in_volume;
 	int sd_in_plex, status, subdisks, tokens, undeffd, volumes;
 	const char *errstr;
-	char buf[BUFSIZ], buf1[BUFSIZ], commandline[BUFSIZ], *ed, *sdname;
+	char buf[BUFSIZ], buf1[BUFSIZ], commandline[BUFSIZ], *sdname;
+	const char *ed;
 	char original[BUFSIZ], tmpfile[20], *token[GV_MAXARGS];
 	char plex[GV_MAXPLEXNAME], volume[GV_MAXVOLNAME];
 
@@ -806,7 +806,8 @@ gvinum_list(int argc, char * const *argv)
 	struct gctl_req *req;
 	int flags, i, j;
 	const char *errstr;
-	char buf[20], *cmd, config[GV_CFG_LEN + 1];
+	char buf[20], config[GV_CFG_LEN + 1];
+	const char *cmd;
 
 	flags = 0;
 	cmd = "list";
@@ -931,7 +932,7 @@ gvinum_move(int argc, char * const *argv)
 }
 
 static void
-gvinum_printconfig(int argc, char * const *argv)
+gvinum_printconfig(int argc __unused, char * const *argv __unused)
 {
 
 	printconfig(stdout, "");
@@ -943,7 +944,7 @@ gvinum_parityop(int argc, char * const *argv, int rebu
 	struct gctl_req *req;
 	int flags, i;
 	const char *errstr;
-	char *op;
+	const char *op;
 
 	if (rebuild) {
 		op = "rebuildparity";
@@ -1214,7 +1215,7 @@ gvinum_start(int argc, char * const *argv)
 }
 
 static void
-gvinum_stop(int argc, char * const *argv)
+gvinum_stop(int argc __unused, char * const *argv __unused)
 {
 	int err, fileid;
 



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