Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id B60E46325B6 for ; Thu, 28 May 2009 09:47:29 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 94482-05; Thu, 28 May 2009 09:47:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gauss.credativ.com (gauss.credativ.com [91.190.177.186]) by mail.postgresql.org (Postfix) with ESMTP id 41E5E632300; Thu, 28 May 2009 09:47:26 -0300 (ADT) Received: from feivel (exit.credativ.com [87.139.82.80]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by gauss.credativ.com (Postfix) with ESMTP id 72F9E9943A8; Thu, 28 May 2009 14:47:23 +0200 (CEST) Received: by feivel (Postfix, from userid 1000) id 06DFA4E1AE; Thu, 28 May 2009 14:47:24 +0200 (CEST) Date: Thu, 28 May 2009 14:47:23 +0200 From: Michael Meskes To: Zdenek Kotala Cc: Michael Meskes , "pgsql-hackers@postgresql.org" Subject: Re: Compiler warning cleanup - unitilized const variables, pointer type mismatch Message-ID: <20090528124723.GA23989@feivel.credativ.lan> Mail-Followup-To: Zdenek Kotala , Michael Meskes , "pgsql-hackers@postgresql.org" References: <1243501880.1372.23.camel@localhost> <20090528113347.GB9247@feivel.credativ.lan> <1243511467.1372.43.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1243511467.1372.43.camel@localhost> User-Agent: Mutt/1.5.19 (2009-01-05) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.281 tagged_above=0 required=5 tests=AWL=0.281 X-Spam-Level: X-Archive-Number: 200905/1224 X-Sequence-Number: 138766 On Thu, May 28, 2009 at 01:51:07PM +0200, Zdenek Kotala wrote: > Problem is with YYLLOC_DEFAULT. When I look on macro definition > > #define YYLLOC_DEFAULT(Current, Rhs, N) \ > Current.first_line = Rhs[1].first_line; \ > Current.first_column = Rhs[1].first_column; \ > Current.last_line = Rhs[N].last_line; \ > Current.last_column = Rhs[N].last_column; > > It seems to me that it is OK, because 1 is used as a index which finally > point on yyerror_range[0]. Wait, this is the bison definition. Well to be more precise the bison definition in your bison version. Mine is different: # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) Having said that, it doesn't really matter as we redefine the macro: #define YYLLOC_DEFAULT(Current, Rhs, N) \ do { \ if (N) \ (Current) = (Rhs)[1]; \ else \ (Current) = (Rhs)[0]; \ } while (0) I have to admit that those version look strikingly unsimilar to me. There is no reference to Rhs[N] in our macro at all. But then I have no idea whether this is needed. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!