Date: Thu, 31 Jul 2014 11:51:23 +0400 From: Sergey Kandaurov <pluknet@freebsd.org> To: Baptiste Daroussin <bapt@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r269323 - head/usr.bin/m4 Message-ID: <CAE-mSOLVf_Ue-vgTed8V8H-44Vn73%2BU5VHaFogk47x-960yYVA@mail.gmail.com> In-Reply-To: <201407310556.s6V5uGWX080856@svn.freebsd.org> References: <201407310556.s6V5uGWX080856@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 31 July 2014 09:56, Baptiste Daroussin <bapt@freebsd.org> wrote: > Author: bapt > Date: Thu Jul 31 05:56:15 2014 > New Revision: 269323 > URL: http://svnweb.freebsd.org/changeset/base/269323 > > Log: > lower warning level to fix build with gcc > > Modified: > head/usr.bin/m4/Makefile > > Modified: head/usr.bin/m4/Makefile > ============================================================================== > --- head/usr.bin/m4/Makefile Thu Jul 31 05:12:21 2014 (r269322) > +++ head/usr.bin/m4/Makefile Thu Jul 31 05:56:15 2014 (r269323) > @@ -16,6 +16,7 @@ NO_WMISSING_VARIABLE_DECLARATIONS= > SRCS= eval.c expr.c look.c main.c misc.c gnum4.c trace.c parser.y tokenizer.l > .PATH: ${.CURDIR}/lib > SRCS+= ohash.c > +WARNS= 3 > > tokenizer.o: parser.h > > I am suspicious of this approach. Unless objections, I'd like to commit the following one (it also follows the NetBSD way in fixing up .Ox m4 import). Although it is low quality as well, it allows to keep WARNS. Index: lib/ohash.c =================================================================== --- lib/ohash.c (revision 269324) +++ lib/ohash.c (working copy) @@ -120,7 +120,7 @@ void * ohash_remove(struct ohash *h, unsigned int i) { - void *result = (void *)h->t[i].p; + void *result = __DECONST(void *, h->t[i].p); if (result == NULL || result == DELETED) return NULL; @@ -141,7 +141,7 @@ if (h->t[i].p == DELETED) return NULL; else - return (void *)h->t[i].p; + return __DECONST(void *, h->t[i].p); } void * @@ -180,7 +180,7 @@ { for (; *pos < h->size; (*pos)++) if (h->t[*pos].p != DELETED && h->t[*pos].p != NULL) - return (void *)h->t[(*pos)++].p; + return __DECONST(void *, h->t[(*pos)++].p); return NULL; } Index: misc.c =================================================================== --- misc.c (revision 269324) +++ misc.c (working copy) @@ -265,7 +265,7 @@ extern char *__progname; void -m4errx(int eval, const char *fmt, ...) +m4errx(int exval, const char *fmt, ...) { fprintf(stderr, "%s: ", __progname); fprintf(stderr, "%s at line %lu: ", CURRENT_NAME, CURRENT_LINE); @@ -277,7 +277,7 @@ va_end(ap); } fprintf(stderr, "\n"); - exit(eval); + exit(exval); } /* -- wbr, pluknet
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAE-mSOLVf_Ue-vgTed8V8H-44Vn73%2BU5VHaFogk47x-960yYVA>