ecpg c++ scope operator lost

Started by Mark Petherover 22 years ago5 messagesbugs
Jump to latest
#1Mark Pether
mutex@redsheriff.com

Ecpg pretty prints my code causing compile errors.

ie. code to compile:

EXEC SQL BEGIN DECLARE SECTION;
char bound_waiting_state =
static_cast<char>(Processor::waiting);
EXEC SQL END DECLARE SECTION;

turns into:

/* exec sql begin declare section */
#line 90 "Schedule.pgcc"
char bound_waiting_state = static_cast < char > ( Processor : :
waiting ) ;
/* exec sql end declare section */
#line 93 "Schedule.pgcc"

The scope operator becomes space padded and compiler barfs.

Work around is to initialise variables outside of declare section.

Regards,
Mark Pether.

#2Michael Meskes
meskes@postgresql.org
In reply to: Mark Pether (#1)
Re: ecpg c++ scope operator lost

On Wed, Dec 17, 2003 at 03:14:31PM -0500, Mark Pether wrote:

Ecpg pretty prints my code causing compile errors.

Please note that ecpg is a precompiler for embedded SQL in C not C++.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

#3Mark Pether
mutex@redsheriff.com
In reply to: Michael Meskes (#2)
Re: ecpg c++ scope operator lost

If that's the case then you'd better change your documentation...

PostgreSQL 7.3 Documentation

Chapter 4. ECPG - Embedded SQL in C
This chapter describes the embedded SQL package for PostgreSQL. It works
with C and *C++.* It was written by Linus Tolke (<linus@epact.se
<mailto:linus@epact.se>>) and Michael Meskes (<meskes@postgresql.org
<mailto:meskes@postgresql.org>>).

Regards,
Mark Pether.

Michael Meskes wrote:

Show quoted text

On Wed, Dec 17, 2003 at 03:14:31PM -0500, Mark Pether wrote:

Ecpg pretty prints my code causing compile errors.

Please note that ecpg is a precompiler for embedded SQL in C not C++.

Michael

#4Michael Meskes
meskes@postgresql.org
In reply to: Mark Pether (#3)
Re: ecpg c++ scope operator lost

On Mon, Dec 22, 2003 at 09:33:00AM -0500, Mark Pether wrote:

If that's the case then you'd better change your documentation...

PostgreSQL 7.3 Documentation

Chapter 4. ECPG - Embedded SQL in C
This chapter describes the embedded SQL package for PostgreSQL. It works
with C and *C++.* It was written by Linus Tolke (<linus@epact.se
...

Please note that ecpg is a precompiler for embedded SQL in C not C++.

Sorry, I didn't know the docs say that. Actually we did add some C++
stuff, so if you can send me a list of what doesn't work I will add this
to the ecpg todo list, but I wouldn't say we guarantee that all C++
constructs work with ecpg.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

#5Michael Meskes
meskes@postgresql.org
In reply to: Mark Pether (#3)
Re: ecpg c++ scope operator lost

On Mon, Dec 22, 2003 at 09:33:00AM -0500, Mark Pether wrote:

If that's the case then you'd better change your documentation...

Fixed. Thanks for pointing me to this.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!