pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Error in ECPG and #if...
3+ messages / 3 participants
[nested] [flat]

* Error in ECPG and #if...
@ 1999-04-20 15:59 Pavel PaJaSoft Janousek <janousek@fonet.cz>
  1999-04-21 03:36 ` Re: [INTERFACES] Error in ECPG and #if... Thomas Lockhart <lockhart@alumni.caltech.edu>
  1999-04-21 11:52 ` Re: [INTERFACES] Error in ECPG and #if... Michael Meskes <meskes@postgresql.org>
  0 siblings, 2 replies; 3+ messages in thread

From: Pavel PaJaSoft Janousek @ 1999-04-20 15:59 UTC (permalink / raw)
  To: pgsql-interfaces

    Hi all,

    I use ECPG distributed with PostgreSQL 6.4.2. and I found next
error..:-(

    ECPG don't know C/C++ preprocessing directives such as #if, #ifdef
etc...

I try this:

..
...
15. #if 0
16. exec sql select count (*) from
17. exec sql commit;
18. #endif

    In this ECPG  say: parse error on line 16.

    But when I use this:
15. // exec sql select count (*) from
16. // exec sql commit;

    ECPG parse this correctly...

    I think, that this is wrong, that ECPG use as comment only /* and //
comment. Construction such as #if 0 is very common way to disable some
source and enable this later... - mainly in debugging proces, of cource.

    Or do I something wrong?

    Thanks...

----------------------------------------------------------------------------
--
Pavel Janousek (PaJaSoft)                              FoNet, spol. s r. o.
Vyvoj software, sprava siti, Unix, Web, Y2K          Anenska 11, 602 00
Brno
E-mail: mailto:Janousek@FoNet.Cz                     Tel.: +420  5  4324
4749
SMS:    mailto:P.Janousek@SMS.Paegas.Cz              Fax.: +420  5  4324
4751
WWW:    http://WWW.FoNet.Cz/                       E-mail:
mailto:Info@FoNet.Cz
----------------------------------------------------------------------------
---





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [INTERFACES] Error in ECPG and #if...
  1999-04-20 15:59 Error in ECPG and #if... Pavel PaJaSoft Janousek <janousek@fonet.cz>
@ 1999-04-21 03:36 ` Thomas Lockhart <lockhart@alumni.caltech.edu>
  1 sibling, 0 replies; 3+ messages in thread

From: Thomas Lockhart @ 1999-04-21 03:36 UTC (permalink / raw)
  To: Pavel PaJaSoft Janousek <janousek@fonet.cz>; +Cc: pgsql-interfaces

> ECPG don't know C/C++ preprocessing directives such as #if, #ifdef
> etc...
>     I think, that this is wrong, that ECPG use as comment only /* and //
> comment. Construction such as #if 0 is very common way to disable some
> source and enable this later... - mainly in debugging proces, of cource.

... but this is not common for ESQL preprocessors. The problem is that
the preprocessor runs before the C/C++ preprocessor, which is the step
which actually handles the #if constructs. ecpg has no knowledge of
those constructs. Remember that to do those correctly one must also
resolve all other preprocessor kinds of things, like #include
directives.

                       - Tom

-- 
Thomas Lockhart				lockhart@alumni.caltech.edu
South Pasadena, California



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [INTERFACES] Error in ECPG and #if...
  1999-04-20 15:59 Error in ECPG and #if... Pavel PaJaSoft Janousek <janousek@fonet.cz>
@ 1999-04-21 11:52 ` Michael Meskes <meskes@postgresql.org>
  1 sibling, 0 replies; 3+ messages in thread

From: Michael Meskes @ 1999-04-21 11:52 UTC (permalink / raw)
  To: Pavel PaJaSoft Janousek <janousek@fonet.cz>; +Cc: pgsql-interfaces

On Tue, Apr 20, 1999 at 05:59:13PM +0200, Pavel PaJaSoft Janousek wrote:
>     I use ECPG distributed with PostgreSQL 6.4.2. and I found next
> error..:-(

Not really.

>     ECPG don't know C/C++ preprocessing directives such as #if, #ifdef
> etc...

That's correct. ECPG only parses stuff between EXEC SQL and ';'. 

> 15. #if 0
> 16. exec sql select count (*) from
> 17. exec sql commit;
> 18. #endif

This is not C code. 

>     In this ECPG  say: parse error on line 16.

Yes, because ECPG parses all embedded SQL code. It does not know about cpp
code.

Michael 

-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael.Meskes@gmx.net          | Use PostgreSQL!



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~1999-04-21 11:52 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-04-20 15:59 Error in ECPG and #if... Pavel PaJaSoft Janousek <janousek@fonet.cz>
1999-04-21 03:36 ` Thomas Lockhart <lockhart@alumni.caltech.edu>
1999-04-21 11:52 ` Michael Meskes <meskes@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox