[llvm-bugs] [Bug 35522] New: DOS line endings (\r\n) result in incorrect output with clang-format

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 4 13:21:25 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35522

            Bug ID: 35522
           Summary: DOS line endings (\r\n) result in incorrect output
                    with clang-format
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: erik.lacharite at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Created attachment 19518
  --> https://bugs.llvm.org/attachment.cgi?id=19518&action=edit
Sample files and output

clang-format produces an incorrect output if DOS line endings (\r\n) are used.
See screenshot in attached in .zip to preview the output.

#### UNIX LINE ENDINGS RESULTS #####

#define YYDPRINTF(Args)          \
  do {                           \
    if (yydebug) YYFPRINTF Args; \
  } while (YYID(0))


#### DOS LINE ENDINGS RESULTS ####

#define YYDPRINTF(Args)          \
  \
do {                             \

    if (yydebug) YYFPRINTF Args; \
  \
}                             \
  while (YYID(0))

###########################



To reproduce:
1. Download both attached sample files in .zip
2. Run each with "clang-format -i -style=google <file>"


may relate to: 
Bug 33124 - ARCMT does not handle \r\n correctly
https://bugs.llvm.org/show_bug.cgi?id=33124

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171204/80eb7aa1/attachment.html>


More information about the llvm-bugs mailing list