[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#252753: Possible error in /usr/include/libintl.h - compiler error with g++ -O3



Package: libc6-dev 
Version: 2.3.2.ds1-11 
 
Compiling this simple testprogram results in an error message: 
 
#include <string> 
#include <iostream> 
 
class foo 
{ 
    std::string s; 
    public: 
      foo (const char *a) : s(a) {}; 
 
      std::string gettext (void) { return s; } 
}; 
 
int main (int argc, char **argv) 
{ 
    foo f("test"); 
    std::string a; 
 
    a=f.gettext(); 
 
    std::cout << "Test: " << a << std::endl; 
 
    return 0; 
} 
g++ -O3 -o t1 t1.cxx 
t1.cxx:11: error: parse error before `,' token 
t1.cxx:11: error: variable declaration is not allowed here 
t1.cxx:11: error: syntax error before `{' token 
t1.cxx:12: error: parse error before `}' token 
t1.cxx: In function `int main(int, char**)': 
t1.cxx:19: error: parse error before `,' token 
t1.cxx:19: error: `dcgettext' undeclared (first use this function) 
t1.cxx:19: error: (Each undeclared identifier is reported only once for 
each 
   function it appears in.) 
 
g++ -v 
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.3/specs 
Configured with: ../src/configure -v 
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr 
--mandir=/usr/share/man --infodir=/usr/share/info 
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared 
--with-system-zlib --enable-nls --without-included-gettext 
--enable-__cxa_atexit --enable-clocale=gnu --enable-debug 
--enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux 
Thread model: posix 
gcc version 3.3.3 (Debian 20040401) 
 
g++ -o t1 t1.cxx 
is OK 
 
Bruno Haible`s solution: 
http://sources.redhat.com/ml/libc-alpha/2004-06/msg00018.html 
 
Herbert 
 
 
 
 
 
 
 
 
 
 
 
 
 
 



Reply to: