Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id E917F1337B92 for ; Tue, 2 Nov 2010 16:34:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 82010-09; Tue, 2 Nov 2010 19:34:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og124.obsmtp.com (exprod7og124.obsmtp.com [64.18.2.26]) by mail.postgresql.org (Postfix) with SMTP id 8B4891337B77; Tue, 2 Nov 2010 16:34:39 -0300 (ADT) Received: from source ([209.85.215.181]) by exprod7ob124.postini.com ([64.18.6.12]) with SMTP ID DSNKTNBnz+lJMfnWE1o0PTCMMcB7+8RqMnyF@postini.com; Tue, 02 Nov 2010 12:34:41 PDT Received: by eyb6 with SMTP id 6so2892617eyb.26 for ; Tue, 02 Nov 2010 12:34:38 -0700 (PDT) Received: by 10.213.7.12 with SMTP id b12mr3740488ebb.76.1288726477969; Tue, 02 Nov 2010 12:34:37 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id q58sm5743595eeh.15.2010.11.02.12.34.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 02 Nov 2010 12:34:37 -0700 (PDT) Message-ID: <4CD067D0.6000900@enterprisedb.com> Date: Tue, 02 Nov 2010 21:34:40 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.12) Gecko/20100913 Icedove/3.0.7 MIME-Version: 1.0 To: Michael Meskes CC: Zoltan Boszormenyi , PostgreSQL Bugs , Korry Douglas Subject: Re: ecpg preprocessor regression in 9.0 References: <4CCEC145.3020409@enterprisedb.com> <4CCEC4D8.2090809@enterprisedb.com> <20101102173913.GA32303@hyperion.credativ.de> In-Reply-To: <20101102173913.GA32303@hyperion.credativ.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201011/20 X-Sequence-Number: 28600 On 02.11.2010 19:39, Michael Meskes wrote: > On Mon, Nov 01, 2010 at 03:47:04PM +0200, Heikki Linnakangas wrote: >> On closer look, it's quite obvious: the code added to >> ECPGdump_a_type thinks that ECPGt_const is a variable type, and >> tries to look up the variable. The straightforward fix is this: >> ... >> But I wonder if there is a better way to identify variable-kind of >> ECPGttypes than list the ones that are not. There's some special >> ECPGttypes still missing from the above if-test, like >> ECPGt_NO_INDICATOR, but I'm not sure if they can ever be passed to >> ECPGdump_a_type. Seems a bit fragile anyway. > > I agree. How about adding a macro definition explicitely checking for the real > variable types? You'd still have to list them all in the macro, but it would definitely be better. The list would then be closer to the enums, in the same header file, making it easier to remember to keep it up-to-date. (Korry's suggestion of making it a function instead of a macro would not have that advantage). -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com