* Compiler Bug?
@ 2000-07-06 8:42 Christian Jabs
0 siblings, 0 replies; only message in thread
From: Christian Jabs @ 2000-07-06 8:42 UTC (permalink / raw)
To: tru64-unix-managers
I think I found a compiler bug that occurs in BCB3 and BCB5 (so I think
it also in BCB4, but I can't prove it).
Try the following two snippets (it should remove spaces from a String):
/----- snip1 ----------------------------/
AnsiString s="Test Test";
while( int Pos = s.AnsiPos(" ") )
{
s = s.SubString(1, Pos - 1) + s.SubString(Pos + 1, s.Length() - Pos);
}
/----- end snip1 ------------------------/
/----- snip2 ----------------------------/
AnsiString s="Test Test";
while( int Pos = s.AnsiPos(" ") )
s = s.SubString(1, Pos - 1) + s.SubString(Pos + 1, s.Length() - Pos);
/----- end snip1 ------------------------/
I would think the assembler code generated by these two snippets are
equal
(or at least equivalent). But in snip2 the code does not behave like one
could think. You can simply see it if you set s to an empty string
(s=""). Though the result in the while inquiry is zero (or false) it
enters the following line.
Is there s.th. wrong in my train of thoughts?
Christian
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-07-06 8:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-07-06 8:42 Compiler Bug? Christian Jabs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox