Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b86QT-0005BR-QS for pgsql-bugs@arkaria.postgresql.org; Wed, 01 Jun 2016 13:43:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b86QT-0006N3-DE for pgsql-bugs@arkaria.postgresql.org; Wed, 01 Jun 2016 13:43:13 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b86QT-0006Mv-0B for pgsql-bugs@postgresql.org; Wed, 01 Jun 2016 13:43:13 +0000 Received: from gauss.credativ.com ([93.94.130.89]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1b86QL-0001tX-T8 for pgsql-bugs@postgresql.org; Wed, 01 Jun 2016 13:43:11 +0000 Received: from gauss.credativ.com (localhost [127.0.0.1]) by gauss.credativ.com (Postfix) with ESMTP id 3BEF2145007B; Wed, 1 Jun 2016 15:43:02 +0200 (CEST) Received: from feivel.credativ.lan (fw-front.credativ.com [62.154.226.94]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mme@gauss.credativ.com) by gauss.credativ.com (Postfix) with ESMTPSA id 11EDA145001D; Wed, 1 Jun 2016 15:43:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by feivel.credativ.lan (Postfix) with ESMTP id 81F8E9A4; Wed, 1 Jun 2016 15:43:00 +0200 (CEST) Message-ID: <1464788580.21529.25.camel@postgresql.org> Subject: Re: BUG #14167: ecpg parser cann't ignore code in #ifdef ? From: Michael Meskes To: pgsql-bugs@postgresql.org Cc: digoal@126.com Date: Wed, 01 Jun 2016 15:43:00 +0200 In-Reply-To: <20160601033334.30388.39448@wrigleys.postgresql.org> References: <20160601033334.30388.39448@wrigleys.postgresql.org> Organization: PostgreSQL Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.2-2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org >   this is my pgc code.   > ... > #ifdef ABC >     err *abc; > #endif > ... > this is ERROR > ecpg -t -c -I/home/digoal/pgsql9.6/include -o t.c t.pgc > t.pgc:15: ERROR: unrecognized data type name "err" > > And use #ifndef and -DABC also error.  > ECPG parser cann't skip code in #ifdef or #ifndef ? '#ifdef' is a C precompiler command and thus is only parsed by cpp et al. If you want ecpg to parse it you have to use 'exec sql ifdef' instead. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Meskes at (Debian|Postgresql) dot Org Jabber: michael at xmpp dot meskes dot org VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs