Re: BUG #15176: ecpg generation error - Mailing list pgsql-bugs

From Michael Meskes
Subject Re: BUG #15176: ecpg generation error
Date
Msg-id 14f85244af19f0607a188b581afa5b0a455554e9.camel@postgresql.org
Whole thread Raw
In response to BUG #15176: ecpg generation error  (PG Bug reporting form <noreply@postgresql.org>)
Responses RE: BUG #15176: ecpg generation error
List pgsql-bugs
Dear Uwe,

> (yes, these empty lines are produced    by ecpg :-) )

Your point being?

> For select statements the generated code compiles, but IMO, the
> parameters
> of all sizeof() calls are wrong. I would expect code like this:

You obviously have no idea what this code is doing nor did you check
with the source code. So what makes you think you can educate us about
what the code should look like? May I remind you that ecpg has been
used for 20 years and on millions and millions of source code. You're
hardly the first one to use it.

>
> The result is even worse, if you try to insert into the database.
> the pgc-code:
> ...
> This code does not compile!

Compiles cleanly on my system.

> If you look to #line 39 you can see the definition of struct
> varchar_1
> inside of struct a_t in function fkt1. So this results in the
> following
> error message:
>
> 1>d:\dev\ems\master\src\db\bdp\app\pgtest\ctestapp.pc(67): error
> C2027:
> Verwendung des undefinierten Typs "fkt1::varchar_1"
> varchar_1 is unknown.

To everyone out there that does not read German, the error message says
that type "fkt1::varchar1" is undefined. Uwe, it surely helps sending
English error messages to an English language mailing list.

Not sure what you or your compiler are doing, but the last time I
checked defining a struct within a struct works nicely in *C*. It
probably does not in C++, but ecpg is not a C++ precompiler!

> After manual correction it compiles:

I hardly call commenting out these lines a correction.

> Could you please repair ecpg, so it generates code, that compiles. :-
> )

Could you please show a different attitude? Otherwise it's highly
unlikely anyone volunteers to use their spare time to help you. And
after all it seems to be you using ecpg wrongly and not ecpg being
buggy.

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


pgsql-bugs by date:

Previous
From: Jan Hamal Dvořák
Date:
Subject: to_json documentation wrt. casts is misleading
Next
From: "Carlsen, Len"
Date:
Subject: RE: BUG #15171: JDBC TIMESTAMP WITH TIME ZONE PSQLException WhenUsing Substitution Parameter