[cfe-dev] [clang-format] Output not deterministic when for single-line comment

Akhil Indurti via cfe-dev cfe-dev at lists.llvm.org
Mon May 14 16:53:35 PDT 2018


Running clang-format on its own output results in a different output for
the following example. Is this expected behavior? The example has a
multi-line comment on a single line of a function body.

$ clang-format -version
clang-format version 7.0.0 (tags/google/stable/2018-01-11)

$ cat foo.c
void foo() {
/* THIS IS A COMMENT */
}

$ clang-format foo.c > foo2.c
$ cat foo2.c
void foo() { /* THIS IS A COMMENT */ }

$ clang-format foo2.c > foo3.c
$ cat foo3.c
void foo() { /* THIS IS A COMMENT */
}

Thank You,
Akhil Indurti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180514/9963bee4/attachment.html>


More information about the cfe-dev mailing list