pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Boszormenyi Zoltan <zb@cybertec.at>
To: Michael Meskes <meskes@postgresql.org>
To: alexsav23@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8608: ECPG: sizeof() in EXEC SQL DECLARE SECTION
Date: Sun, 24 Nov 2013 15:59:40 +0100
Message-ID: <5292145C.5000508@cybertec.at> (raw)
In-Reply-To: <20131124115517.GA1658@feivel.credativ.lan>
References: <E1VitxU-00034v-I6@wrigleys.postgresql.org>
	<20131124115517.GA1658@feivel.credativ.lan>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

2013-11-24 12:55 keltezéssel, Michael Meskes írta:
> On Tue, Nov 19, 2013 at 10:39:48PM +0000, alexsav23@gmail.com wrote:
>> d:\>"c:\Program Files\PostgreSQL\9.3\bin\ecpg.exe"-o 1.c 1.pgc
>> 1.pgc: 4: ERROR: syntax error at or near  "("
>> error deleting output file "1.c"
> And another patch to try. Please send me feedback.

I think it's needlessly narrows the scope of the problem.
Consider this code:

#include <stdio.h>

#define hide_size_of_var sizeof

int main(void) {
     int a[hide_size_of_var(int)];
     int i;

     for (i = 0; i < hide_size_of_var(int); i++) {
         a[i] = i*3;
         printf("i: %d a[i]: %d\n", i, a[i]);
     }

     return 0;
}

It compiles just fine in a C compiler and runs from 0 to 3 as expected.
GCC 4.8.2 doesn't say anything about it with -Wall.

I think you should pass everything through as is inside the '[' and ']' and
let the C compiler fail if the code is not valid.

Best regards,
Zoltán Böszörményi

>
> Michael
>
>


-- 
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
      http://www.postgresql.at/

view thread (6+ messages)  latest in thread

Message-ID: <5292145C.5000508@cybertec.at>
Permalink:  ../5292145C.5000508@cybertec.at/
Also on:    postgresql.org/message-id/5292145C.5000508@cybertec.at

 · 

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: zb@cybertec.at, meskes@postgresql.org, alexsav23@gmail.com
  Subject: Re: BUG #8608: ECPG: sizeof() in EXEC SQL DECLARE SECTION
  In-Reply-To: <5292145C.5000508@cybertec.at>
  References: <E1VitxU-00034v-I6@wrigleys.postgresql.org> <20131124115517.GA1658@feivel.credativ.lan> <5292145C.5000508@cybertec.at>

* 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