Hi Roey,
I did a disassembly. I think code is being generated for the snippet you
sent (I used both opts 0 and 1). What I think is going on is the way the
disassembly generates the code, which in opt 1 look as though none is being
generated for the if-else statement. However, if you look at the disassembly
between opts 0 and 1 for that section, they are almost the same. Code is
being generated for the statement, looks like. However, if you have a more
complete code or specific details I'll look further into it.
Rgds,
Jun-Kiat Lam
Metrowerks Technical Support
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 20, 1999 5:53 PM
Subject: cw6 fails to generate code in some cases
> Hi,
>
> We have run across a very disturbing CodeWarrior 6 bug: there are cases
> where no code is generated for what looks like valid C source.
> Specifically, an entire if-else statement is ignored by CW6. Has anyone
> else run across anything like this? I searched through the FAQ,
> knowledge base and mailing list archives but have not seen any
> reference to similar problems.
>
> Below is an example function that has failed under several test
> configurations. If you have difficulty reproducing the problem, email
> me and I can send you a project that shows off the bug.
>
> Thanks,
>
> Roey Ben-Yoseph <[EMAIL PROTECTED]>
> Globalware Computing
>
> ++++++++++++++++++++++++++++++++++++++++
>
> static Word BuildTextLine(CharPtr dstStr, CharPtr srcStr)
> {
> Word dstStrLen;
> Word srcStrLen;
> Word copyLen;
>
> dstStrLen = StrLen(dstStr);
> srcStrLen = StrLen(srcStr);
>
> if(dstStrLen >= 37)
> return dstStrLen;
>
> //// No code is generated for this source ////
> if( (dstStrLen + srcStrLen) <= 37)
> copyLen = srcStrLen;
> else
> copyLen = (srcStrLen - ( (dstStrLen + srcStrLen) - 37));
> //// No code is generated for this source ////
>
> return copyLen;
> }
>
>
>