pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 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 12:55:17 +0100
Message-ID: <20131124115517.GA1658@feivel.credativ.lan> (raw)
In-Reply-To: <E1VitxU-00034v-I6@wrigleys.postgresql.org>
References: <E1VitxU-00034v-I6@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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.

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
Jabber: michael.meskes at gmail dot com
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachments:

ecpg.sizeof.diff (text/x-diff, 1.0K) download commit 08d1b22b3be2305ad6b83ca275829ff26305f5d7 Author: Michael Meskes <meskes@postgresql.org> Date: Sun Nov 24 12:51:21 2013 +0100 Allow C array definitions to use sizeof(). When parsing C variable definitions ecpg should allow sizeof() operators as array dimensions. diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer index 342b7bc..6ef9f1a 100644 --- a/src/interfaces/ecpg/preproc/ecpg.trailer +++ b/src/interfaces/ecpg/preproc/ecpg.trailer @@ -1865,6 +1865,11 @@ Iresult: Iconst { $$ = $1; } | Iresult '%' Iresult { $$ = cat_str(3, $1, mm_strdup("%"), $3); } | ecpg_sconst { $$ = $1; } | ColId { $$ = $1; } + | ColId '(' ColId ')' { if (pg_strcasecmp($1, "sizeof") != 0) + mmerror(PARSE_ERROR, ET_ERROR, "operator not allowed in variable definition"); + else + $$ = cat_str(4,$1, mm_strdup("("), $3, mm_strdup(")")); + } ; execute_rest: /* EMPTY */ { $$ = EMPTY; }

view thread (6+ messages)  latest in thread

Message-ID: <20131124115517.GA1658@feivel.credativ.lan>
Permalink:  ../20131124115517.GA1658@feivel.credativ.lan/
Also on:    postgresql.org/message-id/20131124115517.GA1658@feivel.credativ.lan

 ·  · 

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

* 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