Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBs1P-0001a4-2v for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Apr 2018 01:17:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBs1O-0003vI-4D for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Apr 2018 01:17:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBs1N-0003uF-Qs for pgsql-bugs@lists.postgresql.org; Fri, 27 Apr 2018 01:17:57 +0000 Received: from mout.kundenserver.de ([217.72.192.74]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fBs1K-0001yY-Pl for pgsql-bugs@lists.postgresql.org; Fri, 27 Apr 2018 01:17:56 +0000 Received: from feivel.credativ.lan ([50.226.116.166]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.183]) with ESMTPSA (Nemesis) id 0M3SaW-1eL8wR3IdU-00r2ZU; Fri, 27 Apr 2018 03:17:52 +0200 Received: from localhost (localhost [127.0.0.1]) by feivel.credativ.lan (Postfix) with ESMTP id 007DA39B; Thu, 26 Apr 2018 18:20:43 +0200 (CEST) Message-ID: <14f85244af19f0607a188b581afa5b0a455554e9.camel@postgresql.org> Subject: Re: BUG #15176: ecpg generation error From: Michael Meskes To: uhoeppner@psi.de, pgsql-bugs@lists.postgresql.org Date: Thu, 26 Apr 2018 18:20:43 +0200 In-Reply-To: <152468741102.19805.13932148777494153815@wrigleys.postgresql.org> References: <152468741102.19805.13932148777494153815@wrigleys.postgresql.org> Organization: PostgreSQL Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:16OTFjFbBx5x/vIgR//btZQSXuTI5OS2FVVVf4/ABb9+MrNOiwf 3hv7wBbuLAw9o4A3wks/mWakJZRJ8EPS/Qlplo6JPzi8WQKleyyIKK6jICTUppfUlxJZ8SP UilJc4PyVsxRrCUEM+jKxA0zGsN8/bSHOUf3I81nwMwyu48LsypcW3/hNfChXeOHv0mbqH8 7JeJ//HM9LgRi2J840Qdw== X-UI-Out-Filterresults: notjunk:1;V01:K0:pcH8BEHExaE=:/Nz8CaehI43B7zf51IxKXK keodVUAQwhaE0bOfYh2rHkCUCv1L6gOne8ZNSCz9xn5ANPq1hErJyznGHkD5E+iGwux9lVY4y WVXU1um00GUy5/LPGekFnNYkhsoX97LdYn/1uWp8YNK7wehRs1iGcE8rfzFa268Poqbg3gJAk fSvBF2AwIaBKOf3AikNEHCTGTDPupd0J/Ts/ImevEjlYT6v/Un1mL1EgSB7KbSFo7x7HVNYoT 3Yf2x/+J9QqYUo6lLnze9tD14eBeUG+GwOyJkrWw5lVtTLUjxU40omzZjuLcRPIsqawN0V85v lYDue+jbqCKPjhmgnQlnMA9jPo4z68kd3tzNMQIdBj7UPwLK4OZTrYNBIntSlN6pwDX16yXcs 6nh9hP8HFhnJaqgERnsQuRq5KKaFv1qBroWcE9HPLG+nBC55CUqK3XvCm7UUTHF3QG9vZFQoh Hh6a4VjjN8mX3psADHrAq5cN/UYoh9FIbxk+dw4xv/QVaR+QaNxQHsvCeS173eclO1k1tPGy1 xY8Z1VEsvDy0/ED9FaFN2m2HVa0dplE85Oydlcmg1b30EPPdk11Dzm94pKWoZ55gg/ZW45Ufi GGLyMIIekGcuPQ/Eh/9BAFkE0xkcatGl70emvfK6/3WzvU8HuBoVZVWiuxVnanfeiMC6Ilxsr dvBkHCBkJ4qP+xogNYQ13z93wlNKEhr6EA8CZWFy+fYdZfknLLp54fqGTFauZUnSjlXY42GZ7 LCEgUBEZIpA8qyr+ List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dear Uwe, =20 =20 > (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. >=20 > 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: >=20 > 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 --=20 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=C3=A7a Bar=C3=A7a! SF 49ers! Use Debian GNU/Linux, Post= greSQL