[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tests/tagdemo: ISO C++
From: |
Gary V. Vaughan |
Subject: |
Re: tests/tagdemo: ISO C++ |
Date: |
Mon, 04 Oct 2004 17:06:32 +0100 |
User-agent: |
Mozilla Thunderbird 0.8 (X11/20040913) |
Hi Ralf, Bob,
Bob Friesenhahn wrote:
> On Sun, 3 Oct 2004, Ralf Wildenhues wrote:
>
>> This patch brings the tagdemo up to ISO C++. I do not know how
>> well compilers support this, but eventually something like this
>> should be applied.
>>
>> So whoever has a compiler that does not understand this, speak
>> up ;)
None of the solaris compilers I'm testing understand it. However, neither
are they any worse off. I get this error from make in tests/tagdemo with
or without the patch applied:
CC -G -zdefs -nolib -hlibfoo.so.0 -o .libs/libfoo.so.0.0.0 .libs/foo.o
-Qoption ld -z -Qoption ld allextract,./.libs/libconv.a -Qoption ld -z
-Qoption ld defaultextract -lm
Undefined first referenced
symbol in file
std::cout .libs/foo.o
[Hint: static member std::cout must be defined in the program]
std::ostream &std::ostream::put(char) .libs/foo.o
std::ostream &std::ostream::operator<<(std::ostream &(*)(std::ostream &))
.libs/foo.o
std::ostream &std::operator<<(std::ostream &,const char*) .libs/foo.o
std::ostream &std::ostream::operator<<(double) .libs/foo.o
std::ostream &std::ostream::flush() .libs/foo.o
ld: fatal: Symbol referencing errors. No output written to
.libs/libfoo.so.0.0.0*** Error code 1
make: Fatal error: Command failed for target `libfoo.la'
I can get it to compile by removing -zdefs, but that simply allows undefined
symbols in libfoo, which isn't what we want. Not sure what to do about this
one...
HP-UX's aCC passes tagdemo tests without the patch, but with the patch applied
gives:
aCC -DPACKAGE_NAME=\"tagdemo\" -DPACKAGE_TARNAME=\"tagdemo\"
-DPACKAGE_VERSION=\"1.0\" "-DPACKAGE_STRING=\"tagdemo 1.0\""
-DPACKAGE_BUGREPORT=\"address@hidden" -DPACKAGE=\"tagdemo\"
-DVERSION=\"1.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\"
-DHAVE_MATH_H=1 -I. -I/home/gary/libtool/libtool-1.9e/tests/tagdemo
-I/home/gary/libtool/libtool-1.9e/tests/tagdemo/../.. -g -c
/home/gary/libtool/libtool-1.9e/tests/tagdemo/foo.cpp +Z -DPIC -o .libs/foo.o
Error 112: "/home/gary/libtool/libtool-1.9e/tests/tagdemo/foo.cpp", line 23 #
Include file <iostream> not found.
#include <iostream>
^^^^^^^^^^
Error 697: "/home/gary/libtool/libtool-1.9e/tests/tagdemo/foo.cpp", line 29 #
Only namespace names are valid here.
using namespace std;
^^^
Error 172: "/home/gary/libtool/libtool-1.9e/tests/tagdemo/foo.cpp", line 35 #
Undeclared variable 'cout'.
cout << "cos (0.0) = " << (double) cos ((double) 0.0) << endl;
^^^^
Error 172: "/home/gary/libtool/libtool-1.9e/tests/tagdemo/foo.cpp", line 42 #
Undeclared variable 'cout'.
cout << "** This is libfoo (tagdemo) **" << endl;
^^^^
gmake: *** [foo.lo] Error 1
The tagdemo tests pass with cxx on Tru64 Unix with or without the patch applied.
> I believe that I have encountered a SGI C++ compiler for Irix which
> properly supports namespaces but is missing the standard C++ headers.
Similarly for CC on IRIX 6.5, all tests pass with or without the patch.
> Regardless, use of standard C++ syntax should be preferred at this time.
In general I agree, but since we are providing a portability tool here,
we want to see the testsuite pass in as many places as possible. And this
patch reduces portability of the test case.
>> 2004-10-03 Ralf Wildenhues <address@hidden>
>>
>> * tests/tagdemo/foo.cpp, main.cpp: Use ANSI C++.
>>
Rejected for the reasons above.
Cheers,
Gary.
--
Gary V. Vaughan ())_. address@hidden,gnu.org}
Research Scientist ( '/ http://tkd.kicks-ass.net
GNU Hacker / )= http://www.gnu.org/software/libtool
Technical Author `(_~)_ http://sources.redhat.com/autobook
signature.asc
Description: OpenPGP digital signature