Jump to content
  • Advertisement
Sign in to follow this  
FrankCashio

Bug Notice DevCpp 4.9.9.0

This topic is 5002 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

IDE: DevCpp 4.9.9.0; Compiler: mingw 3.3.1 I ran across this little bastard while I was working one of my projects
lpProgramMemory = &Memory[(PB*BANK_SIZE) +  PC];
    switch(*lpProgramMemory){  
//////////// ADC Add With Carry  \\\\\\\\\\\\
       case 0x61: // ADC (dp,X)    
	
	 . . // ..		


Here
///////////////// Processor Flags  \\\\\\\\\\\\\\\
BOOL bEmulation; // 6502 Emulation mode 8 bit;


And Here
//////////// Internal Registers \\\\\\\\\\\\\\\\\
WORD A;             // the Accumulator


The compiler told me that A, And bEumulation were both undeclared And that case 0x61 was unreachable, all of which were not true The culprit was the \\\ marks in the comments in the code

Won’t Work
//////////// ADC Add With Carry  \\\\\\\\\\\\
       case 0x61: // ADC (dp,X)    

Works 
//////////// ADC Add With Carry 
       case 0x61: // ADC (dp,X)    


weird huh? -Frank

Share this post


Link to post
Share on other sites
Advertisement
That's not a bug in Dev C++ or MinGW, that's the fault of the programming language. The \ at the end of a line is a line continuation token, which means that if you have a \ at the end of a line, it makes that line part of the line with the \ at the end. That means that if you have a // style comment with a \ at the end of the line, it comments out the next line too.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
backslash and the end of a line extends the comment to the following one.

Share this post


Link to post
Share on other sites
Wow, That's about the dumbest thing I possible ever heard of.
Why in gods name would anyone ever for any reason think of implementing something like that into a programming language.
It's just asking for trouble.

This world is a sad sad place.

- Frank

Share this post


Link to post
Share on other sites
It's one of the things C++ inherited from C, which had only /* */ style comments, so this kind of problem didn't come up. In particular, line continuation characters were designed to support preprocessor macro definitions.

Share this post


Link to post
Share on other sites
I Know but it's in a comment So it should igonre it. That is in a sane world.


I think it's an over-sight on in the Dev-Cpp IDE a bug.

-Frank

Share this post


Link to post
Share on other sites
Quote:
Original post by FrankCashio
I think it's an over-sight on in the Dev-Cpp IDE a bug.

-Frank


It's not. It's characteristic of the language itself. just don't use those god-awful \\\\\\\\\\\\\\\ comments.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!