Bug 19144 - Unusual behavior in /usr/include/g++-3/std/bastring.cc
Summary: Unusual behavior in /usr/include/g++-3/std/bastring.cc
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: libstdc++
Version: 7.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-10-15 20:21 UTC by Andrew Dodd
Modified: 2007-04-18 16:29 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2004-10-01 15:44:42 UTC


Attachments (Terms of Use)

Description Andrew Dodd 2000-10-15 20:21:24 UTC
When trying to compile an application I'm maintaining, I get this error:

/usr/include/g++-3/std/bastring.cc: In method `basic_string<charT, 
traits, Allocator> &basic_string<charT, traits, Allocator>::replace 
(unsigned int, unsigned int, const charT *, unsigned int) [with charT = 
char, traits = string_char_traits<char>, Allocator = 
__default_alloc_template<true, 0>]':
/usr/include/g++-3/std/bastring.h:223:   instantiated from
`basic_string<charT, tr
aits, Allocator>::assign (const charT *, unsigned int) [with charT = char,
traits 
= string_char_traits<char>, Allocator = __default_alloc_template<true, 0>]'
CU30Decoder.cpp:225:   instantiated from here
/usr/include/g++-3/std/bastring.cc:156: `assert' undeclared (first use 
this function)
/usr/include/g++-3/std/bastring.cc:156: (Each undeclared identifier is 
reported only once for each function it appears in.)

Looking at bastring.cc, it does have a #include <cassert> line, which
SHOULD be declaring assert().

I've had numerous problems before where gcc refuses to acknowledge the
declaration of assert() by including cassert or assert.h.  But I've never
seen it give errors in the C++ library code itself.

BTW, this is NOT the fault of a bug in line 225 of CU30Decoder.cpp - I am
positive of that, since line 225 is a comment.  (And deleting that entire
comment block does nothing - No matter what line 225 is, gcc complains
about it.)

On a side note:  Is there a document on how to port from older versions of
gcc to the 2.9x series ANYHWERE?  I need more information than "GCC is
stricter" - I need to know how to fix my code so it conforms.  I am by no
means a C++ god, and many of these errors completely baffle me.  I can work
around most of them eventually, but a document or FAQ would be lovely and I
cannot find one.

Comment 1 Andrew Dodd 2000-10-17 20:01:05 UTC
The problem also occurs (same error) when attempting to compile qVIX
(http://cu30.sourceforge.net/) from sources.

The initial bug report covers the error occuring in our video codec, which is
not yet open-source.  But the bug also recurs in qvix.cc in the open-source
portion of the application.

c++ -DHAVE_CONFIG_H -I. -I. -I.. -I../codec -I../network -I../display
-I../huffman    -I/usr/local/include/gtk-- -I/usr/local/lib/gtkmm/include 
-I/usr/lib/gtkmm/include -I/usr/lib/glib/include 	-I/usr/include/sigc++
-I/usr/local/lib/sigc++/include 	-I/usr/lib/sigc++/include -O3 -D_REENTRANT
-march=i586         -fomit-frame-pointer -c qvix.cc
In file included from qvixmain_glade.hh:45,
                 from qvixmain.hh:30,
                 from qvix.cc:25:
/usr/include/gtk--/notebook.h: In method `void 
Gtk::Notebook::Proxy_switch_page::operator() 
(Gtk::Notebook_Helpers::Page *)':
/usr/include/gtk--/notebook.h:364: warning: passing negative value `-100000000'
for argument 2 of 
`Gtk::Notebook::Proxy_switch_page::emit (Gtk::Notebook_Helpers::Page *, unsigned
int)'
/usr/include/gtk--/notebook.h: In method `void 
Gtk::Notebook::Proxy_switch_page::emit (Gtk::Notebook_Helpers::Page 
*)':
/usr/include/gtk--/notebook.h:365: warning: passing negative value `-100000000'
for argument 2 of 
`Gtk::Notebook::Proxy_switch_page::emit (Gtk::Notebook_Helpers::Page *, unsigned
int)'
/usr/include/g++-3/std/bastring.cc: In method `basic_string<charT, 
traits, Allocator> &basic_string<charT, traits, Allocator>::replace 
(unsigned int, unsigned int, const charT *, unsigned int) [with charT = 
char, traits = string_char_traits<char>, Allocator = 
__default_alloc_template<true, 0>]':
/usr/include/g++-3/std/bastring.h:223:   instantiated from `basic_string<charT,
traits, Allocator>::assign (const charT *, unsigned int) [with charT = char,
traits = string_char_traits<char>, Allocator = __default_alloc_template<true,
0>]'
/usr/include/g++-3/std/bastring.h:225:   instantiated from `basic_string<charT,
traits, Allocator>::assign (const charT *) [with charT = char, traits =
string_char_traits<char>, Allocator = __default_alloc_template<true, 0>]'
/usr/include/g++-3/std/bastring.h:183:   instantiated from `basic_string<charT,
traits, Allocator>::basic_string (const charT *) [with charT = char, traits =
string_char_traits<char>, Allocator = __default_alloc_template<true, 0>]'
/usr/include/gtk--/statusbar.h:48:   instantiated from here
/usr/include/g++-3/std/bastring.cc:156: `assert' undeclared (first use 
this function)
/usr/include/g++-3/std/bastring.cc:156: (Each undeclared identifier is 
reported only once for each function it appears in.)


Comment 2 Cristian Gafton 2000-10-17 23:33:57 UTC
assigned to jakub

Comment 3 Benjamin Kosnik 2004-10-01 15:44:42 UTC
Unable to reproduce in 3.2.x/3.3.x/3.4.x




Note You need to log in before you can comment on or make changes to this bug.