Cppstyle calls clang-format with `-fallback-style` command line parameter
The -fallback-style command line parameter is not available in all versions of clang-format and older versions of clang-format will fail to run if the command line option is passed.
I am forced to use an older development environment which only supports clang-format v3.4. This version of clang-format does not support the fallback style option, so cppstyle fails.
Perhaps an option to enable / disable this feature?
Some more information that may be relevant:
- CppStyle 1.5.0.0 (from the Eclipse Marketplace)
- Eclipse IDE for C/C++ Developers
- Version: Oxygen.1a Release (4.7.1a)
- Build id: 20171005-1200
- OS: Linux, v.3.11.0-26-generic, x86_64 / gtk 3.4.2, WebKit 1.8.3
- $ clang-format --version
- LLVM version 3.4
- Optimized build.
- Built Dec 6 2014 (20:05:48)
Error in CppStyle Output Tab
clang-format return error (1).
clang-format: Unknown command line argument '-fallback-style=Google'. Try: '/usr/bin/clang-format -help'
clang-format: Did you mean '-warn-stack-size=Google'?
Need a config for using older clang-format versions.
$ clang-format --version
LLVM (http://llvm.org/):
LLVM version 3.4.2
Optimized build.
Built Dec 7 2015 (09:37:36).
Default target: x86_64-redhat-linux-gnu
Host CPU: x86-64
$ clang-format -fallback-style=google
clang-format: Unknown command line argument '-fallback-style=google'. Try: 'clang-format -help'
clang-format: Did you mean '-warn-stack-size=google'?
clang-format-fix.sh
#!/bin/bash
FILECMD=$1
CMDTAG="-assume-filename="
NEWFILECMD=${FILECMD/$CMDTAG/\ }
/usr/bin/clang-format $2 $4 $5 $NEWFILECMD
Hi, I've been hit by this bug as well, with my clang-format v5! Unfortunately I cannot use a different version, so please fix it!
Thanks @tonybeckett for the workaround... I will try that
Actually I realized that the problem I hit was due to using the system-installed clang-format instead of the one I wanted to use that is: /opt/rh/llvm-toolset-7/root/usr/bin/clang-format (from Centos7 software collections)