Skip site navigation (1) Skip section navigation (2)

gcc 3.0.1

From: Leandro Fanzone <leandro(at)hasar(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: gcc 3.0.1
Date: 2001-08-24 20:12:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-novice
I have compiled PostgreSQL 7.1.2 with gcc 3.0.1, and have the following
problem: if I include first libpq++.h before iostream, id est:

#include <libpq++.h>
#include <iostream>

the compiler complains:

In file included from /usr/include/g++-v3/bits/locale_facets.tcc:38,
                 from /usr/include/g++-v3/bits/std_locale.h:41,
                 from /usr/include/g++-v3/bits/ostream.tcc:32,
                 from /usr/include/g++-v3/bits/std_ostream.h:278,
                 from /usr/include/g++-v3/bits/std_iostream.h:40,
                 from /usr/include/g++-v3/iostream:31,
/usr/include/g++-v3/bits/std_limits.h:286:5: missing binary operator
/usr/include/g++-v3/bits/std_limits.h:483:5: missing binary operator

This is because somewhere in PostgreSQL you have the following code:

#ifndef true
#define true ((bool)1)

and it seems that in gcc 3.0.1, "true" is not defined, or that "true" is
a reserved word doesn't mean that is defined, or that the offending
lines below they don't exist in std_limit.h, I don't know as I no longer
have the old compiler. The workaround is to include first iostream, and
then libpq++. The offending lines in std_limits.h are the following:

#ifdef __CHAR_UNSIGNED__
#define __glibcpp_plain_char_is_signed false
#define __glibcpp_plain_char_is_signed true

end somewhere below this one:

#if __glibcpp_plain_char_is_signed

which is preprocessed to:

#if true

when the #include<iostream> is before libpq++ and:

#if ((bool)1)

otherwise. This last statement is invalid for the compiler.

Leandro Fanzone


pgsql-novice by date

Next:From: Peter MoscattDate: 2001-08-25 01:49:57
Subject: How to allow other users create databases ?
Previous:From: Barry LindDate: 2001-08-24 17:30:27
Subject: Re: Error Codes, JDBC, SQLExceptions

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2001-08-24 20:53:48
Subject: Re: PATCH proposed with new features for CREATE TABLE
Previous:From: Barry LindDate: 2001-08-24 20:12:14
Subject: Re: JDBC changes for 7.2... some questions...

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group