Sign in to follow this  
FrankCashio

Bug Notice DevCpp 4.9.9.0

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
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
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this