[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: crash in c++ library (sstream)
> From: "Thomas Meier" <firstname.lastname@example.org>
> Date: Tue, 8 Apr 2003 16:55:06 +0200
> I upgraded to the newest distribution, but it crashed again - so I checked
> the compile options:
> We used the option "-fPIC".
It seems you compiled the *program* with -fPIC? In the normal
case, that'd just needlessly result in a slower, larger program,
but it mustn't crash.
Indeed, compiling with:
"g++-cris -pedantic -W -Wall -mlinux -O2 -fPIC /tmp/g.cc -o gg"
gives me a working binary: I get the "hello" and no crash.
*But* if I compile with
"g++-cris -pedantic -W -Wall -mlinux -fPIC /tmp/g.cc -o gg"
(that is, without optimization) I get a binary that crashes.
Without optimization and without -fPIC, it works too. I'll
investigate this problem.
Could you please quote the *exact* command you use to compile
the file you sent?
> After omiting that option, all was doing well !
I'm happy that the workaround coincides with normal usage.
There doesn't seem to be an immediate need for a bugfix release
of the tools, but I'll make sure to get the behavior I describe
above fixed in a future release. However, it'd be premature to
draw the conclusion that it's the same problem *you* see without
your quoted compile command.
> Note: there is still a static cast missing in g++-include/sstream.h line 171
> (compiler warning).
With the command lines above, I get the warnings below. If this
is what you refer to, the sstream warnings will be fixed in a
In file included from /tmp/g.cc:1:
/usr/local/cris/lib/gcc-lib/cris/2.96/g++-include/sstream: In method `int stringbuf::sync ()':
/usr/local/cris/lib/gcc-lib/cris/2.96/g++-include/sstream:171: warning: comparison between a signed and
/usr/local/cris/lib/gcc-lib/cris/2.96/g++-include/sstream:171: warning: an unsigned integer expressions
/tmp/g.cc: In function `int main (int, char **)':
/tmp/g.cc:5: warning: unused parameter `int argc'
/tmp/g.cc:5: warning: unused parameter `char **argv'