RE: [GD-Windows] VC makes absurd code
Brought to you by:
vexxed72
From: Andrew G. <ag...@cl...> - 2002-07-12 10:39:19
|
I'm not sure what you want here.... Do you want us to randomly suggest possible reasons why something doesn't work on your machine and works on others? Memory issues Optimisation settings Your desk is located over an ancient indian burial ground Who knows! Without seeing what you're attempting to do it's very hard to even guess what the problem maybe. For what it's worth I wouldn't consider casting a char* to or from a std::string a clever thing to do. If you have a std::string and want a const char*, use .c_str(), that's what it's there for. If you have a char* and want a std::string, construct a new object. Andrew Grant- Climax Brighton > -----Original Message----- > From: Sergei Miloikov [mailto:se...@ha...] > Sent: 12 July 2002 11:23 > To: Gam...@li... > Subject: Re: [GD-Windows] VC makes absurd code > > > That is nothing to do with actual code, because as I said it > happens on > single computer, everywhere it generates the right,working > code. I see the > compiler to generate absurd code once, but it was about the > 'else' clause of > one 'if' that was supposed never to execute and was not > written by that > reason, but since compiler do not understand such thing it > generates the > 'else' clause which was totally absurd - but this dead code > was there and > remains in the executable. For no reason. > My case is not like that - it is perfectly linear code, and one single > cast - there are allocations in that cast (new std::string > object comes to > life), some RB_tree accessing (?!) and a lot of code actually, then > optimizer assumes that allocator can not allocate code (?!?!) > and pushes 0 > to the stack, where the pointer must be pushed... then it is > accessed and it > crashes happily, god damn it! > > P.S. After seeing that piece of code, I use std::string <-> > const char* > casting very carefully, it is amazing how much code can > produce one single > line like that! > > ----- Original Message ----- > From: "Andrew Grant" <ag...@cl...> > To: <Gam...@li...> > Sent: Friday, July 12, 2002 1:07 PM > Subject: RE: [GD-Windows] VC makes absurd code > > > > Maybe you could post a code snippet of what you're trying > to do and where > it > > dies? > > > > Andrew Grant- > > Climax Brighton > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Gadgets, caffeine, t-shirts, fun stuff. > http://thinkgeek.com/sf > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |