Thread: Additional fixes to ecpg - please apply patch

Additional fixes to ecpg - please apply patch

From
"Nicolas Bazin"
Date:
This new patch corrects 2 new bugs:
bug 1:
EXEC SQL define JOKER '?';
EXEC SQL define LINE "LINE";
could not be parsed
 
bug 2:
EXEC SQL define LEN 2;
memset(dst, '?', LEN);
 
was translated into
 
memset(dst, '?', 2
#line XX "thefile.ec"
);
 
which could not be compiled with gcc for instance
 
Nicolas BAZIN
Attachment

Re: Additional fixes to ecpg - please apply patch

From
Michael Meskes
Date:
It seems you patch is reversed.

Anyway, I will look into it. I will have to change it some though as it
contains C++ comments. :-)

Michael
--
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

Re: Additional fixes to ecpg - please apply patch

From
Michael Meskes
Date:
On Fri, Mar 08, 2002 at 06:35:18PM +1100, Nicolas Bazin wrote:
> This new patch corrects 2 new bugs:

Slighlty differently fixed this in CVS.

Thanks for reporting the bugs. Please tell me of my fix is not
sufficient.

Michael
--
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

Re: Additional fixes to ecpg - please apply patch

From
jtv
Date:
On Sun, Mar 10, 2002 at 12:40:36PM +0100, Michael Meskes wrote:
>
> Anyway, I will look into it. I will have to change it some though as it
> contains C++ comments. :-)

Which are also valid C comments nowadays, IIRC.  OTOH not all compilers
seem to honour that change...


Jeroen


Re: Additional fixes to ecpg - please apply patch

From
Michael Meskes
Date:
On Sun, Mar 10, 2002 at 02:28:12PM +0100, jtv wrote:
> On Sun, Mar 10, 2002 at 12:40:36PM +0100, Michael Meskes wrote:
> >
> > Anyway, I will look into it. I will have to change it some though as it
> > contains C++ comments. :-)
>
> Which are also valid C comments nowadays, IIRC.  OTOH not all compilers
> seem to honour that change...

Yes, that's what I meant. :-(

Michael
--
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

Re: Additional fixes to ecpg - please apply patch

From
"Nicolas Bazin"
Date:
It works except that you overwrote a previous patch I submitted that was already applied (see mail joined).
Sorry for sending you a diff in the wrong order.
Also I though the type definition syntax could be enhanced. Instaead of defining
EXEC SQL type mytype is struct {
...
};
typedef struct {
...
} mytype;
 
It would be better to allow the following:
EXEC SQL begin declare section;
typedef struct {
...
} mytype;
 
EXEC SQL end declare section;
 
Both syntax can be maintained for compatibility of existing application, but I find 
the second one easier to maintain because there is no code duplication.
 
Can you do it ? 
 
Nicolas
 
 
On Fri, Mar 08, 2002 at 06:35:18PM +1100, Nicolas Bazin wrote:
> This new patch corrects 2 new bugs:

Slighlty differently fixed this in CVS.

Thanks for reporting the bugs. Please tell me of my fix is not
sufficient.

Michael
-- 
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

 
Please apply patch.
----- Original Message -----
Sent: Tuesday, March 05, 2002 12:08 PM
Subject: Re: BUG#599 & BUG 606 correction

The end of a define section is tested too soon during the parsing of ecpg. This patch makes sure that the parser only do the test at the end of the file being parsed.
 
Please apply this patch to src/interface/ecpg/preproc/pgc.l
 
Nicolas BAZIN
Attachment

Re: Subject: Re: Additional fixes to ecpg - please apply patch

From
Michael Meskes
Date:
On Mon, Mar 11, 2002 at 12:41:33PM +1100, Nicolas Bazin wrote:
> It works except that you overwrote a previous patch I submitted that was already applied (see mail joined).

I'm sorry for that. Since I thought cvs would merge the changes I didn't
check.

> Sorry for sending you a diff in the wrong order.

No problem.

> Also I though the type definition syntax could be enhanced. Instaead of defining
> ...
> Both syntax can be maintained for compatibility of existing
> application, but I find the second one easier to maintain because
> there is no code duplication.Can you do it ? Nicolas

Yes, you are right. The first should be kept for compatibility, but the
second i seasier to use. I will ad this to my todo list. But I have no
idea at all, when I will find time to implement it. So, if you can send
patches, they are more than welcome.

Michael
-- 
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!


Re: Subject: Re: Additional fixes to ecpg - please apply patch

From
"Nicolas Bazin"
Date:
I can give it a try, but I'm not familiar with lex and yacc so I can't
promise anything.

Nicolas
----- Original Message -----
From: "Michael Meskes" <meskes@postgresql.org>
To: "Nicolas Bazin" <nbazin@ingenico.com.au>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Monday, March 11, 2002 11:55 PM
Subject: Re: Subject: Re: Additional fixes to ecpg - please apply patch


> On Mon, Mar 11, 2002 at 12:41:33PM +1100, Nicolas Bazin wrote:
> > It works except that you overwrote a previous patch I submitted that was
already applied (see mail joined).
>
> I'm sorry for that. Since I thought cvs would merge the changes I didn't
> check.
>
> > Sorry for sending you a diff in the wrong order.
>
> No problem.
>
> > Also I though the type definition syntax could be enhanced. Instaead of
defining
> > ...
> > Both syntax can be maintained for compatibility of existing
> > application, but I find the second one easier to maintain because
> > there is no code duplication.Can you do it ? Nicolas
>
> Yes, you are right. The first should be kept for compatibility, but the
> second i seasier to use. I will ad this to my todo list. But I have no
> idea at all, when I will find time to implement it. So, if you can send
> patches, they are more than welcome.
>
> Michael
> --
> Michael Meskes
> Michael@Fam-Meskes.De
> Go SF 49ers! Go Rhein Fire!
> Use Debian GNU/Linux! Use PostgreSQL!
>




Re: [HACKERS] Additional fixes to ecpg - please apply patch

From
Bruce Momjian
Date:
jtv wrote:
> On Sun, Mar 10, 2002 at 12:40:36PM +0100, Michael Meskes wrote:
> >
> > Anyway, I will look into it. I will have to change it some though as it
> > contains C++ comments. :-)
>
> Which are also valid C comments nowadays, IIRC.  OTOH not all compilers
> seem to honour that change...

We don't support // comments in PostgreSQL in C.  Too many platforms
don't accept them.  We are not targeting only modern systems.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026