Re: BUG #14167: ecpg parser cann't ignore code in #ifdef ?

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Cc: digoal(at)126(dot)com
Subject: Re: BUG #14167: ecpg parser cann't ignore code in #ifdef ?
Date: 2016-06-01 13:43:00
Message-ID: 1464788580.21529.25.camel@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>   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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message timofeid 2016-06-01 13:48:19 BUG #14171: Wrong FSM file after switching hot standby to master
Previous Message dag-hammerich 2016-06-01 12:06:22 BUG #14170: error message in case LOCALE de_DE.UTF8 is used in combination with CLIENT_ENCODING=LATIN1