[Bug preprocessor/93920] New: Wrong comments preprocessing using -E and -CC with escaped end-of-line

mail@allan-blanchard.fr gcc-bugzilla@gcc.gnu.org
Tue Feb 25 08:16:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93920

            Bug ID: 93920
           Summary: Wrong comments preprocessing using -E and -CC with
                    escaped end-of-line
           Product: gcc
           Version: 9.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mail@allan-blanchard.fr
  Target Milestone: ---

If a comment contains a line with an escaped end-of-line, the last character of
the line is printed a second time on a new line after preprocessing.

void f(void){
  /*
    line \
contentX
    new line
  */
}

Command:

$ gcc -E -CC example.c

Result:

// ... headers, etc.
# 1 "./example.cpp"
void f(void){
  /*
  line contentX
X
  new line
  */
}

Found on:
- gcc (Arch Linux 9.2.1+20200130-2) 9.2.1 20200130

Reproduced on:
- gcc version 8.3.0 (Ubuntu 8.3.0-6ubuntu1)
- all GCC versions available on GodBolt.


More information about the Gcc-bugs mailing list