public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15773] New: Error, if compiled with -O3 (gettext method name)
@ 2004-06-02 10:29 herbert at linuxhacker dot at
  2004-06-02 11:31 ` [Bug c++/15773] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: herbert at linuxhacker dot at @ 2004-06-02 10:29 UTC (permalink / raw)
  To: gcc-bugs

#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;
}

Compiled and linked with:
g++ -o t1 t1.cxx
./t1
Test: test

And now with -O3:
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)

And now the old compiler 2.95:
g++-2.95 -O3 -o t1 t1.cxx
./t1
Test: test

g++-2.95 -v
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20011002 (Debian prerelease)

-- 
           Summary: Error, if compiled with -O3 (gettext method name)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: herbert at linuxhacker dot at
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15773


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/15773] Error, if compiled with -O3 (gettext method name)
  2004-06-02 10:29 [Bug c++/15773] New: Error, if compiled with -O3 (gettext method name) herbert at linuxhacker dot at
@ 2004-06-02 11:31 ` pinskia at gcc dot gnu dot org
  2004-06-02 14:08 ` herbert at linuxhacker dot at
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-02 11:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-02 11:30 -------
Can you provide the preprocessed source, I think this is a case of glibc using defines instead of inline 
functions.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15773


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/15773] Error, if compiled with -O3 (gettext method name)
  2004-06-02 10:29 [Bug c++/15773] New: Error, if compiled with -O3 (gettext method name) herbert at linuxhacker dot at
  2004-06-02 11:31 ` [Bug c++/15773] " pinskia at gcc dot gnu dot org
@ 2004-06-02 14:08 ` herbert at linuxhacker dot at
  2004-06-02 14:14 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: herbert at linuxhacker dot at @ 2004-06-02 14:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From herbert at linuxhacker dot at  2004-06-02 14:08 -------
(In reply to comment #1)
> Can you provide the preprocessed source, I think this is a case of glibc using
defines instead of inline 
> functions.

I found in /usr/include/libintl.h i the following:
/* Optimized version of the function above.  */
#if defined __OPTIMIZE__

[...] snipped

# define gettext(msgid) dgettext (NULL, msgid)

# define dgettext(domainname, msgid) \
  dcgettext (domainname, msgid, LC_MESSAGES)

[...]

The t1.ii contains:

          foo (const char *a) : s(a) {}

          std::string dcgettext (__null, void, __LC_MESSAGES) { return s; }
};

I think, it is the same error:
http://lists.gnu.org/archive/html/bug-gnu-utils/2002-06/msg00156.html

It' look like, that this error is no compiler failure?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15773


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/15773] Error, if compiled with -O3 (gettext method name)
  2004-06-02 10:29 [Bug c++/15773] New: Error, if compiled with -O3 (gettext method name) herbert at linuxhacker dot at
  2004-06-02 11:31 ` [Bug c++/15773] " pinskia at gcc dot gnu dot org
  2004-06-02 14:08 ` herbert at linuxhacker dot at
@ 2004-06-02 14:14 ` pinskia at gcc dot gnu dot org
  2004-06-03 12:06 ` bruno at clisp dot org
  2004-08-19 19:42 ` bangerth at dealii dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-02 14:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-02 14:14 -------
Not our bug, and it looks like the people who maintain gettext have it already fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15773


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/15773] Error, if compiled with -O3 (gettext method name)
  2004-06-02 10:29 [Bug c++/15773] New: Error, if compiled with -O3 (gettext method name) herbert at linuxhacker dot at
                   ` (2 preceding siblings ...)
  2004-06-02 14:14 ` pinskia at gcc dot gnu dot org
@ 2004-06-03 12:06 ` bruno at clisp dot org
  2004-08-19 19:42 ` bangerth at dealii dot org
  4 siblings, 0 replies; 6+ messages in thread
From: bruno at clisp dot org @ 2004-06-03 12:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bruno at clisp dot org  2004-06-03 12:06 -------
It's a bug in glibc's <libintl.h> header that happens to hit with g++ 3.4 because 
c++locale.h in g++ 3.4 now #includes <libintl.h> which it didn't do in earlier versions 
of g++. Reported to libc-alpha today. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15773


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/15773] Error, if compiled with -O3 (gettext method name)
  2004-06-02 10:29 [Bug c++/15773] New: Error, if compiled with -O3 (gettext method name) herbert at linuxhacker dot at
                   ` (3 preceding siblings ...)
  2004-06-03 12:06 ` bruno at clisp dot org
@ 2004-08-19 19:42 ` bangerth at dealii dot org
  4 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2004-08-19 19:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-08-19 19:41 -------
*** Bug 17109 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |krelisnet at softhome dot
                   |                            |net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15773


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-08-19 19:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-02 10:29 [Bug c++/15773] New: Error, if compiled with -O3 (gettext method name) herbert at linuxhacker dot at
2004-06-02 11:31 ` [Bug c++/15773] " pinskia at gcc dot gnu dot org
2004-06-02 14:08 ` herbert at linuxhacker dot at
2004-06-02 14:14 ` pinskia at gcc dot gnu dot org
2004-06-03 12:06 ` bruno at clisp dot org
2004-08-19 19:42 ` bangerth at dealii dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).