Author Topic: Backslash to continue a line  (Read 5009 times)

vergamota

  • Guest
Backslash to continue a line
« on: September 12, 2007, 05:33:19 pm »
I found a bug, and it is easy reproduceble.
First of all, sorry if I am posting in the wrong place, and my terrible english, or something like that, but I'm just trying to help the Code::Blocks devellopment.

Before I post it, I've got the last nightly version (4461, september 11), and the problem remains.

In C, when it has the backslash ( \ ) caracter before a new line caracter, the new line caracter is "deleted" from compilation.
So, it will join this line with the next one, even it is a commented line.
Example:

int Test()
{
  return 0;
  //This is a comment\\
}


We got an error, cause the MingW compiler and MS compiler recognize like a commented line "}", and it will be asking for a "}" caracter at the end, but the Code Blocks IDE doesn't show this line like a comment, and the compiler gets the error.

The unique IDE that I found, able to solve this problem is the Microsoft Visual C++ 2008 Beta 2. (I didn't try with older version of Visual Studio)

Best regards.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Backslash to continue a line
« Reply #1 on: September 12, 2007, 05:59:54 pm »
This is not a C::B bug. Even if it's a bug, it should be reported to the respective compiler development teams. :)
Be a part of the solution, not a part of the problem.

Offline XayC

  • Multiple posting newcomer
  • *
  • Posts: 94
Re: Backslash to continue a line
« Reply #2 on: September 12, 2007, 06:03:16 pm »
So if I understand correctly, the fact that Gcc is reporting an error for your example is right. What is not is the fact that, in CB editor, the following line (which is part of the comment) is not colored as a comment.

I guess that is a Scintilla text editor problem. Also, is there any reason for the double backslash in the example?

Regards, XayC

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Backslash to continue a line
« Reply #3 on: September 12, 2007, 06:11:49 pm »
I guess that is a Scintilla text editor problem. Also, is there any reason for the double backslash in the example?

You are quite right. This is a Scintilla bug. You may consider reporting this to the Scintilla development team. :)
Be a part of the solution, not a part of the problem.

vergamota

  • Guest
Re: Backslash to continue a line
« Reply #4 on: September 12, 2007, 06:21:37 pm »
OK!
I'm going to do that guys!
Thank you!
And sorry by posting it here...
I didn't know that the highlighting is done by Scintilla.

Best Regards.