Re: BUG #15176: ecpg generation error

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: uhoeppner(at)psi(dot)de, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15176: ecpg generation error
Date: 2018-04-26 16:20:43
Message-ID: 14f85244af19f0607a188b581afa5b0a455554e9.camel@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Carlsen, Len 2018-04-26 16:25:01 RE: BUG #15171: JDBC TIMESTAMP WITH TIME ZONE PSQLException When Using Substitution Parameter
Previous Message Jan Hamal Dvořák 2018-04-26 14:17:20 to_json documentation wrt. casts is misleading