clang-format behavior differs between chroot and vanilla linux version |
|||
Issue descriptionI'm noticing some discrepancies between the output of clang-format inside the Chromium OS chroot versus the vanilla clang-format. Take a look at https://chromium-review.googlesource.com/#/c/336320/2/bsdrm/src/drm_pipe.c@199. That was the output of the following clang-format run: ~/trunk/src/platform/drm-tests/bsdrm $ clang-format -style=file -i src/*.c include/*.h The "else" token should be on the same line as the surrounding closing and opening braces. .clang-format in ~/trunk/src/platform/drm-tests has "BreakBeforeBraces: Linux" which dictates that behavior. clang-format does the correct thing on goobuntu and on a vanilla arch install. The clang-format version inside of my chroot is: clang-format version 3.8.0 (/var/cache/chromeos-cache/distfiles/host/egit-src/clang.git 4483c0162c2672fc09fb738e9c683ebde1f146f3) (/var/cache/chromeos-cache/distfiles/host/egit-src/llvm.git fad81ab170b3d422f0aaa15b88157fdb16d3e75d). On my goobuntu machine: clang-format version google3-trunk (trunk r265040). On the arch install: clang-format version 3.7.1 (tags/RELEASE_371/final).
,
Apr 5 2016
Without the .clang-format file, the clang-format inside chroot works fine. So why not modify the .clang-format file to remove that line?
,
Apr 5 2016
The intention of that line is to actually have the brace style called "Linux". Outside the chroot, with the exact same .clang-format style, we get the proper "} else {" on the same line, but inside the chroot, we get } else\n{". Regardless of how we change the .clang-format inside drm-tests, this is unexpected behavior.
,
Apr 5 2016
Yes, found an upstream patch for it. And we will include it for next clang roll. commit d86f4ca5e4d5460232d70bb1b80c86cde54bb0bd Author: Daniel Jasper <djasper@google.com> Date: Mon Dec 14 08:24:16 2015 +0000 clang-format: Fix style default for WebKit and Linux styles.
,
Sep 13 2016
This should be fixed.
,
Mar 17 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by vapier@chromium.org
, Apr 1 2016Owner: yunlian@chromium.org