Thread: ECPG error message

ECPG error message

From
Antonio Sergio de Mello e Souza
Date:
Hi all,


When I try to compile source code with these variable declarations:
 18 EXEC SQL BEGIN DECLARE SECTION; 19 struct FIELDS_t { 20     char         cod[16]; 21     long double  val; 22 }
fields;23 char command[100]; 24 EXEC SQL END DECLARE SECTION;
 
 $ ecpg -t -I /usr/local/pgsql/include -o tstexecute.c tstexecute.ec

I get this error message:
 tstexecute.ec:20: ERROR: parse error at or near "double"

What's the problem with long double?
Isn't it a standard C data type?

I'm using PostgreSQL 7.1.2, compiled with options:     --with-tcl --enable-locale --enable-multibyte=LATIN1

and my system is a:
 Linux version 2.2.16-13cl ( root@mapi2.conectiva.com.br 
<mailto:root@mapi2.conectiva.com.br> ) (gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)) #1 seg jun 26
17:15:04BRST 2000 Detected 398201 kHz processor. Memory: 127848k/131008k available (1028k kernel code, 416k reserved,
1648kdata, 68k init) CPU: Intel Celeron (Mendocino) stepping 05
 
.

Regards,

Antonio Sergio






Re: ECPG error message

From
Michael Meskes
Date:
On Mon, Oct 22, 2001 at 10:44:19AM -0400, Antonio Sergio de Mello e Souza wrote:
> When I try to compile source code with these variable declarations:
> 
>  18 EXEC SQL BEGIN DECLARE SECTION;
>  19 struct FIELDS_t {
>  20     char         cod[16];
>  21     long double  val;

ecpg does not know long double.

> What's the problem with long double?
> Isn't it a standard C data type?

Is it? Is it available on non-gcc compilers too?

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


Re: ECPG error message

From
Tom Lane
Date:
Michael Meskes <meskes@postgresql.org> writes:
>> What's the problem with long double?
>> Isn't it a standard C data type?

> Is it? Is it available on non-gcc compilers too?

"long double" doesn't exist in ANSI C; it's a new feature of C99.

Since we have no backend datatype that corresponds to long double,
I don't see any strong reason for ecpg to support it.
        regards, tom lane