[llvm-bugs] [Bug 38953] New: clang-format breaks code by inserting spaces inside macro calls
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Sep 14 11:03:09 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=38953
Bug ID: 38953
Summary: clang-format breaks code by inserting spaces inside
macro calls
Product: clang
Version: 7.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Formatter
Assignee: unassignedclangbugs at nondot.org
Reporter: ignat.loskutov at gmail.com
CC: djasper at google.com, klimek at google.com,
llvm-bugs at lists.llvm.org
$ cat test.c
#include <stdio.h>
#define AS_STRING(x) #x
int main() {
puts(AS_STRING(string-with-minus));
}
$ gcc test.c && ./a.out
string-with-minus
$ clang-format-7 -i test.c && gcc test.c && ./a.out
string - with - minus
$ cat test.c
#include <stdio.h>
#define AS_STRING(x) #x
int main() { puts(AS_STRING(string - with - minus)); }
$ lsb_release -d
Description: Ubuntu 18.04.1 LTS
$ dpkg-query --showformat='${Version}\n' --show clang-format-7
1:7~svn323616-1
The code changed its behavior after formatting because some whitespace was
added inside a macro call.
--
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/20180914/61b734a4/attachment.html>
More information about the llvm-bugs
mailing list