Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 31644633D69; Thu, 28 May 2009 08:50:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 74244-10; Thu, 28 May 2009 08:50:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gmp-eb-inf-1.sun.com (gmp-eb-inf-1.sun.com [192.18.6.21]) by mail.postgresql.org (Postfix) with ESMTP id A9FD56338E2; Thu, 28 May 2009 08:50:43 -0300 (ADT) Received: from fe-emea-09.sun.com (gmp-eb-lb-1-fe3.eu.sun.com [192.18.6.10]) by gmp-eb-inf-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n4SBoTeO018865; Thu, 28 May 2009 11:50:41 GMT MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset=UTF-8 Received: from conversion-daemon.fe-emea-09.sun.com by fe-emea-09.sun.com (Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009)) id <0KKC00N00Q601C00@fe-emea-09.sun.com>; Thu, 28 May 2009 12:50:29 +0100 (BST) Received: from [192.168.1.100] ([unknown] [89.102.157.161]) by fe-emea-09.sun.com (Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009)) with ESMTPSA id <0KKC0010LRJEV320@fe-emea-09.sun.com>; Thu, 28 May 2009 12:50:03 +0100 (BST) Date: Thu, 28 May 2009 13:51:07 +0200 From: Zdenek Kotala Subject: Re: Compiler warning cleanup - unitilized const variables, pointer type mismatch In-reply-to: <20090528113347.GB9247@feivel.credativ.lan> To: Michael Meskes Cc: "pgsql-hackers@postgresql.org" Message-id: <1243511467.1372.43.camel@localhost> X-Mailer: Evolution 2.26.1.1 References: <1243501880.1372.23.camel@localhost> <20090528113347.GB9247@feivel.credativ.lan> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200905/1217 X-Sequence-Number: 138759 Michael Meskes píše v čt 28. 05. 2009 v 13:33 +0200: > On Thu, May 28, 2009 at 11:11:20AM +0200, Zdenek Kotala wrote: > > I attached another cleanup patch which fixes following warnings reported > > by Sun Studio: > > ... > > "preproc.c", line 39569: warning: pointer expression or its operand do not point to the same object yyerror_range, result is undefined and non-portable > > ... > > Following list is still unfixed plus see my comments: > > > > "gram.c", line 28487: warning: pointer expression or its operand do not point to the same object yyerror_range, result is undefined and non-portable > > ... > > These two should be the same, both coming from bison. Both files are > auto-generated, thus it might be bison that has to be fixed to remove this > warning. yeah it is generated, but question is if generated code is valid or it is bug in bison. If it bison bug we need to care about it. There is the code: yyerror_range[1] = yylloc; /* Using YYLLOC is tempting, but would change the location of the look-ahead. YYLOC is available though. */ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); *++yylsp = yyloc; 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]. > Given that I didn't find any mentioning of preproc in your patch I > suppose it just hit the wrong list though. I'm sorry copy paste error. Yeah, I did not fix preproc too. Zdenek