Advertisement

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

Started by June 21, 2001 01:20 AM
5 comments, last by MadProgrammer 23 years, 7 months ago
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
You''re probably missing a "}" on the function before it.


War Worlds - A 3D Real-Time Strategy game in development.
Advertisement
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
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
i know what you mean... something as simple as a } or ; is so easily missed.

Scott

Email
Website

"If you try and don''t succeed, destroy all evidence that you tried."
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
Advertisement
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é

Real programmers don't document, if it was hard to write it should be hard to understand

This topic is closed to new replies.

Advertisement