From owner-svn-src-all@FreeBSD.ORG Thu Jul 31 07:51:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DD98948; Thu, 31 Jul 2014 07:51:26 +0000 (UTC) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 926962681; Thu, 31 Jul 2014 07:51:25 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id ho1so8843108wib.8 for ; Thu, 31 Jul 2014 00:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Pq1Ux9zOcqiXCsSgrHEwDGLmP0WD8nX0Rm5CmE23aN8=; b=vM4mLDf1wZ+FHMcfxHGixza88+Eze10J9v5qIQsgON/n2kMs/MDUpjmAceJH35RoPa MdlYz808IyfJmUcaxz6cSA1CZ2QJQlvqRKiuk8gRHBTmeYraE4AeNUchIsSb5Oj6mYi1 CgzAqEPINP379okK3rLysuwASVFiZJcbY2fYUtOIjQWQtUNdN5dajtj12uoU22qgQYIc SBSQ/1ustL+6nHqlkJOrE3zbjBX7UG8MsO0Jk8diBCR9NQgJgTmM6+97Bxy/HprSIytP JpOg6CikZN8YBMl1D1OBXER2h73DPGZkZDXpOjHai38ztv6YEWvyuJDYjYTVaL7Q7936 zj2Q== MIME-Version: 1.0 X-Received: by 10.194.110.7 with SMTP id hw7mr14216986wjb.38.1406793083817; Thu, 31 Jul 2014 00:51:23 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.217.157.137 with HTTP; Thu, 31 Jul 2014 00:51:23 -0700 (PDT) In-Reply-To: <201407310556.s6V5uGWX080856@svn.freebsd.org> References: <201407310556.s6V5uGWX080856@svn.freebsd.org> Date: Thu, 31 Jul 2014 11:51:23 +0400 X-Google-Sender-Auth: ECLG5nfO3vSzX-rL3lzUIiacPys Message-ID: Subject: Re: svn commit: r269323 - head/usr.bin/m4 From: Sergey Kandaurov To: Baptiste Daroussin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2014 07:51:26 -0000 On 31 July 2014 09:56, Baptiste Daroussin 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