pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Meskes <meskes@postgresql.org>
To: uhoeppner@psi.de
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15176: ecpg generation error
Date: Thu, 26 Apr 2018 18:20:43 +0200
Message-ID: <14f85244af19f0607a188b581afa5b0a455554e9.camel@postgresql.org> (raw)
In-Reply-To: <152468741102.19805.13932148777494153815@wrigleys.postgresql.org>
References: <152468741102.19805.13932148777494153815@wrigleys.postgresql.org>

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




view thread (4+ messages)  latest in thread

Message-ID: <14f85244af19f0607a188b581afa5b0a455554e9.camel@postgresql.org>
Permalink:  ../14f85244af19f0607a188b581afa5b0a455554e9.camel@postgresql.org/
Also on:    postgresql.org/message-id/14f85244af19f0607a188b581afa5b0a455554e9.camel@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: meskes@postgresql.org, uhoeppner@psi.de
  Subject: Re: BUG #15176: ecpg generation error
  In-Reply-To: <14f85244af19f0607a188b581afa5b0a455554e9.camel@postgresql.org>
  References: <152468741102.19805.13932148777494153815@wrigleys.postgresql.org> <14f85244af19f0607a188b581afa5b0a455554e9.camel@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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