Archived

This topic is now archived and is closed to further replies.

MadProgrammer

MS VC6 is pissing me off!!!!!!!!!!

Recommended Posts

MS VC is pissing me off!!!!! I have a function: void DisplayFrame() { /* there''s some code in here, but the ENTIRE body of the function is commented out! */ } and i get this error: error C2601: ''DisplayFrame'' : local function definitions are illegal WTF is that????????? HELP PLZ! i''m a really mad MadProgrammer

Share this post


Link to post
Share on other sites
Yeah, I hate it to. Just the other day I was working on something, part of my code was inline assembly that was basically this:

dec cl
test cl, cl
jnz JUMPTOSOMEWHERE

and MSVC6.0 (with latest service packs) changed it to this:

dec cl
test cl, cl
jne JUMPTOSOMEWHERE

It took me an hour to find the mistake, I only found it cus I decided to look at the dissasembly...ms needs a keyword that won''t change the asm like they do with gcc.

--Andrew

Share this post


Link to post
Share on other sites
that is sooooo wierd. i compiled it last night, backed it up to a zip file, and went to bed. this morning, i tried to compile, and i get that freaky error. i eventually go back an i AM missing a } somewhere, but it was a ways before my function.

Man, i really look like a newbie to c++ now! =(

MadProgrammer

Share this post


Link to post
Share on other sites
quote:

dec cl
test cl, cl
jnz JUMPTOSOMEWHERE

and MSVC6.0 (with latest service packs) changed it to this:

dec cl
test cl, cl
jne JUMPTOSOMEWHERE



I believe jne and jnz resolve to the same opcode (a lot of x86 jump instructions are like this.)

Edited by - mhkrause on June 23, 2001 7:58:24 PM

Edited by - mhkrause on June 23, 2001 7:59:13 PM

Share this post


Link to post
Share on other sites
Both the jnz (jump on not zero) and jne (jump on not equal) jump if the zero-flag is set. So the two instructions will do the same. test cl, cl will actually just subtract cl and cl but will not store the result. If the result was zero, the zero-flag is set (and the zero-flag will always be set because cl-cl is always zero). And since the zero-flag will be set in all cases the jnz/jne will always jump.

-René

Share this post


Link to post
Share on other sites