Thread: libpq++ current sources don't compile with older C++ compilers

libpq++ current sources don't compile with older C++ compilers

From
Tom Lane
Date:
Today I did something I usually do about once per release cycle: try to
build the system with HP's vendor cc, rather than gcc which I prefer.
This usually turns up some portability issues, and indeed I found some.
One that I'm not entirely sure about how to fix is that libpq++ no 
longer builds at all:

aCC  +z -I../../../src/interfaces/libpq -I../../../src/include -I/usr/local/include  -c -o pgconnection.o
pgconnection.cc
Error 56: "pgconnection.cc", line 20 # Namespaces are not yet implemented.   using namespace std;
^^^^^^^^^^^^^^^^^^^^

Given that we have a HAVE_NAMESPACE_STD configure symbol, I do not
understand why unconditional "using"s have been inserted into the
libpq++ files.  Shouldn't these be protected by #ifdef
HAVE_NAMESPACE_STD?  Or is there a different fix that's more
appropriate?
        regards, tom lane


Re: libpq++ current sources don't compile with older C++ compilers

From
pgsql-hackers@thewrittenword.com
Date:
On Mon, Aug 27, 2001 at 04:16:57PM -0400, Tom Lane wrote:
> Today I did something I usually do about once per release cycle: try to
> build the system with HP's vendor cc, rather than gcc which I prefer.
> This usually turns up some portability issues, and indeed I found some.
> One that I'm not entirely sure about how to fix is that libpq++ no 
> longer builds at all:
> 
> aCC  +z -I../../../src/interfaces/libpq -I../../../src/include -I/usr/local/include  -c -o pgconnection.o
pgconnection.cc
> Error 56: "pgconnection.cc", line 20 # Namespaces are not yet implemented.
>     using namespace std;
>     ^^^^^^^^^^^^^^^^^^^^
> 
> Given that we have a HAVE_NAMESPACE_STD configure symbol, I do not
> understand why unconditional "using"s have been inserted into the
> libpq++ files.  Shouldn't these be protected by #ifdef
> HAVE_NAMESPACE_STD?  Or is there a different fix that's more
> appropriate?

What version of aCC are you using? Newer releases support -AA which
provide the std namespace. This, of course, doesn't answer your
question.

-- 
albert chin (china@thewrittenword.com)


Re: libpq++ current sources don't compile with older C++ compilers

From
Tom Lane
Date:
pgsql-hackers@thewrittenword.com writes:
> What version of aCC are you using?

$ what /opt/aCC/bin/aCC
/opt/aCC/bin/aCC:       HP aC++ B3910B A.01.00       HP ANSI C++ B3910B A.00.03        /usr/lib/libc: $Revision: 76.3
$

It's whatever shipped with HPUX 10.20, AFAIR.  For my purposes, the
fact that it's not the latest and greatest is exactly the point ...

> Newer releases support -AA which provide the std namespace. This, of
> course, doesn't answer your question.

No, but it does point up the fact that we do not select -AA anyway.
        regards, tom lane


Re: libpq++ current sources don't compile with older C++ compilers

From
Bruce Momjian
Date:

Tom, I am sure it is an oversight.  Can you fix it?

> Today I did something I usually do about once per release cycle: try to
> build the system with HP's vendor cc, rather than gcc which I prefer.
> This usually turns up some portability issues, and indeed I found some.
> One that I'm not entirely sure about how to fix is that libpq++ no 
> longer builds at all:
> 
> aCC  +z -I../../../src/interfaces/libpq -I../../../src/include -I/usr/local/include  -c -o pgconnection.o
pgconnection.cc
> Error 56: "pgconnection.cc", line 20 # Namespaces are not yet implemented.
>     using namespace std;
>     ^^^^^^^^^^^^^^^^^^^^
> 
> Given that we have a HAVE_NAMESPACE_STD configure symbol, I do not
> understand why unconditional "using"s have been inserted into the
> libpq++ files.  Shouldn't these be protected by #ifdef
> HAVE_NAMESPACE_STD?  Or is there a different fix that's more
> appropriate?
> 
>             regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 

--  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,
Pennsylvania19026