[Bug c/44355] New: "\ " at the end of a comment

2010-05-31 Thread romain dot failliot at gmail dot com
Hi!
We've seen a strange bug at work today.
Simply copy/paste this code:

#include 
int main()
{
printf("Hello\n"); // \ 
printf("World\n");
return 0;
}

Verify there is a space after the backspace.
The compilation goes well (there is a warning though with -Wall), but at the
execution you'll only see "Hello". The word "World" has been wiped out by the
\.
It seems like the begin and end spaces on the line are trimmed and so it
doesn't detect the character '\ '.

If it's the standard, then it's not a bug. But I must admit I'm not sure...

Thanks,
Romain


-- 
   Summary: "\ " at the end of a comment
   Product: gcc
   Version: 4.4.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
     Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: romain dot failliot at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44355



[Bug c/44355] "\ " at the end of a comment

2010-05-31 Thread romain dot failliot at gmail dot com


--- Comment #2 from romain dot failliot at gmail dot com  2010-05-31 18:10 
---
Even if there is a space after the '\'?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44355



[Bug c/44355] "\ " at the end of a comment

2010-05-31 Thread romain dot failliot at gmail dot com


--- Comment #4 from romain dot failliot at gmail dot com  2010-05-31 18:39 
---
I totally understand that the \ at the end of a line extends the comment to the
other line, but I thought this was only if the '\' is the very last character
of this line.

What I try to understand is that if it's also the standard behavior when the
line ends with "\ ". Because, to me, "\ " is an escape sequence (well that was
how we used it at work).

But again, I might be totally wrong. I'm just trying to be sure you understood
my point. It's all about the tailing space.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44355