Date: Mon, 22 Nov 2010 20:10:48 +0000 (UTC) From: Bruce Cran <brucec@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r215704 - in head: bin/sh sbin/bsdlabel sbin/geom/class/eli sbin/geom/class/part sbin/geom/class/virstor sbin/growfs sbin/gvinum sbin/hastctl sbin/mknod usr.bin/ar usr.bin/bc Message-ID: <201011222010.oAMKAmVc004141@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brucec Date: Mon Nov 22 20:10:48 2010 New Revision: 215704 URL: http://svn.freebsd.org/changeset/base/215704 Log: Fix some more warnings found by clang. Modified: head/bin/sh/arith_lex.l head/sbin/bsdlabel/bsdlabel.c head/sbin/geom/class/eli/geom_eli.c head/sbin/geom/class/part/geom_part.c head/sbin/geom/class/virstor/geom_virstor.c head/sbin/growfs/debug.c head/sbin/gvinum/gvinum.c head/sbin/hastctl/Makefile head/sbin/mknod/mknod.c head/usr.bin/ar/acplex.l head/usr.bin/bc/scan.l Modified: head/bin/sh/arith_lex.l ============================================================================== --- head/bin/sh/arith_lex.l Mon Nov 22 19:52:44 2010 (r215703) +++ head/bin/sh/arith_lex.l Mon Nov 22 20:10:48 2010 (r215704) @@ -55,6 +55,7 @@ int yylex(void); #define YY_INPUT(buf,result,max) \ result = (*buf = *arith_buf++) ? 1 : YY_NULL; #define YY_NO_UNPUT +#define YY_NO_INPUT %} %% Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Mon Nov 22 19:52:44 2010 (r215703) +++ head/sbin/bsdlabel/bsdlabel.c Mon Nov 22 20:10:48 2010 (r215704) @@ -515,7 +515,7 @@ readlabel(int flag) f = open(specname, O_RDONLY); if (f < 0) - err(1, specname); + err(1, "%s", specname); if (is_file) get_file_parms(f); else { Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Mon Nov 22 19:52:44 2010 (r215703) +++ head/sbin/geom/class/eli/geom_eli.c Mon Nov 22 20:10:48 2010 (r215704) @@ -374,7 +374,7 @@ eli_genkey_files(struct gctl_req *req, b if (!gctl_has_param(req, argname)) return (i); - file = gctl_get_ascii(req, argname); + file = gctl_get_ascii(req, "%s", argname); assert(file != NULL); if (strcmp(file, "-") == 0) Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Mon Nov 22 19:52:44 2010 (r215703) +++ head/sbin/geom/class/part/geom_part.c Mon Nov 22 20:10:48 2010 (r215704) @@ -614,7 +614,7 @@ static int gpart_show_hasopt(struct gctl_req *req, const char *opt, const char *elt) { - if (!gctl_get_int(req, opt)) + if (!gctl_get_int(req, "%s", opt)) return (0); if (elt != NULL) Modified: head/sbin/geom/class/virstor/geom_virstor.c ============================================================================== --- head/sbin/geom/class/virstor/geom_virstor.c Mon Nov 22 19:52:44 2010 (r215703) +++ head/sbin/geom/class/virstor/geom_virstor.c Mon Nov 22 20:10:48 2010 (r215704) @@ -276,7 +276,7 @@ virstor_label(struct gctl_req *req) msize = secsize = 0; for (i = 1; i < (unsigned)nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); - name = gctl_get_ascii(req, param); + name = gctl_get_ascii(req, "%s", param); ssize = g_get_sectorsize(name); if (ssize == 0) fprintf(stderr, "%s for %s\n", strerror(errno), name); @@ -336,7 +336,7 @@ virstor_label(struct gctl_req *req) for (i = 1; i < (unsigned)nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); - name = gctl_get_ascii(req, param); + name = gctl_get_ascii(req, "%s", param); if (verbose) printf(" %s", name); @@ -417,7 +417,7 @@ virstor_label(struct gctl_req *req) /* Ok, store metadata. */ for (i = 1; i < (unsigned)nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); - name = gctl_get_ascii(req, param); + name = gctl_get_ascii(req, "%s", param); msize = g_get_mediasize(name); ssize = g_get_sectorsize(name); @@ -434,7 +434,7 @@ virstor_label(struct gctl_req *req) if (verbose) printf("(%u chunks) ", md.chunk_count); /* Check to make sure last sector is unused */ - if ((off_t)(md.chunk_count * md.md_chunk_size) > msize-ssize) + if ((off_t)(md.chunk_count * md.md_chunk_size) > (off_t)(msize-ssize)) md.chunk_count--; md.chunk_next = 0; if (i != 1) { @@ -499,7 +499,7 @@ virstor_clear(struct gctl_req *req) } for (i = 0; i < (unsigned)nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); - name = gctl_get_ascii(req, param); + name = gctl_get_ascii(req, "%s", param); error = g_metadata_clear(name, G_VIRSTOR_MAGIC); if (error != 0) { @@ -564,7 +564,7 @@ virstor_dump(struct gctl_req *req) } for (i = 0; i < nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); - name = gctl_get_ascii(req, param); + name = gctl_get_ascii(req, "%s", param); error = g_metadata_read(name, (u_char *) & tmpmd, sizeof(tmpmd), G_VIRSTOR_MAGIC); Modified: head/sbin/growfs/debug.c ============================================================================== --- head/sbin/growfs/debug.c Mon Nov 22 19:52:44 2010 (r215703) +++ head/sbin/growfs/debug.c Mon Nov 22 20:10:48 2010 (r215704) @@ -281,7 +281,7 @@ dbg_dump_fs(struct fs *sb, const char *c */ fprintf(dbg_log, "maxbsize int32_t 0x%08x\n", sb->fs_maxbsize); - fprintf(dbg_log, "unrefs int64_t 0x%08x\n", + fprintf(dbg_log, "unrefs int64_t 0x%08jx\n", sb->fs_unrefs); fprintf(dbg_log, "sblockloc int64_t 0x%08x%08x\n", ((unsigned int *)&(sb->fs_sblockloc))[1], Modified: head/sbin/gvinum/gvinum.c ============================================================================== --- head/sbin/gvinum/gvinum.c Mon Nov 22 19:52:44 2010 (r215703) +++ head/sbin/gvinum/gvinum.c Mon Nov 22 20:10:48 2010 (r215704) @@ -1427,5 +1427,5 @@ printconfig(FILE *of, char *comment) if (*comment != '\0') fprintf(of, "# Current configuration:\n"); - fprintf(of, buf); + fprintf(of, "%s", buf); } Modified: head/sbin/hastctl/Makefile ============================================================================== --- head/sbin/hastctl/Makefile Mon Nov 22 19:52:44 2010 (r215703) +++ head/sbin/hastctl/Makefile Mon Nov 22 20:10:48 2010 (r215704) @@ -24,6 +24,7 @@ CFLAGS+=-DINET6 .endif # This is needed to have WARNS > 1. CFLAGS+=-DYY_NO_UNPUT +CFLAGS+=-DYY_NO_INPUT DPADD= ${LIBL} LDADD= -ll Modified: head/sbin/mknod/mknod.c ============================================================================== --- head/sbin/mknod/mknod.c Mon Nov 22 19:52:44 2010 (r215703) +++ head/sbin/mknod/mknod.c Mon Nov 22 20:10:48 2010 (r215704) @@ -139,7 +139,7 @@ main(int argc, char **argv) errx(1, "%s: non-numeric minor number", argv[4]); range_error |= errno; dev = makedev(mymajor, myminor); - if (range_error || major(dev) != (u_int) mymajor || + if (range_error || major(dev) != mymajor || (long)(u_int)minor(dev) != myminor) errx(1, "major or minor number too large"); } else { Modified: head/usr.bin/ar/acplex.l ============================================================================== --- head/usr.bin/ar/acplex.l Mon Nov 22 19:52:44 2010 (r215703) +++ head/usr.bin/ar/acplex.l Mon Nov 22 20:10:48 2010 (r215704) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include "y.tab.h" #define YY_NO_UNPUT +#define YY_NO_INPUT int lineno = 1; int yylex(void); Modified: head/usr.bin/bc/scan.l ============================================================================== --- head/usr.bin/bc/scan.l Mon Nov 22 19:52:44 2010 (r215703) +++ head/usr.bin/bc/scan.l Mon Nov 22 20:10:48 2010 (r215704) @@ -46,6 +46,7 @@ static void init_strbuf(void); static void add_str(const char *); static int bc_yyinput(char *, int); +#define YY_NO_INPUT #undef YY_INPUT #define YY_INPUT(buf,retval,max) \ (retval = bc_yyinput(buf, max))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011222010.oAMKAmVc004141>