Better_Software_Header_MobileBetter_Software_Header_Web

Find what you need - explore our website and developer resources

Clang Tidy, part 2: Integrate qmake and other build systems using Bear

Automated refactoring of your source code using powerful open-source tooling

sudo apt-get install bear
git clone https://github.com/rizsotto/Bear
cd Bear
cmake .; make; make install
<checkout qtremoteobjects>
cd qtremoteobjects
mkcd build
qmake -spec linux-clang ..
bear make
head compile_commands.json
[
{
"command": "c++ -c -pipe -g -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_BUILD_REMOTEOBJECTS_LIB ... -I/home/kfunk/devel/src/qt5.8/qtremoteobjects/src/remoteobjects ... -o .obj/qconnection_local_backend.o /home/kfunk/devel/src/qt5.8/qtremoteobjects/src/remoteobjects/qconnection_local_backend.cpp",
"directory": "/home/kfunk/devel/src/qt5.8/qtremoteobjects/build/src/remoteobjects",
"file": "/home/kfunk/devel/src/qt5.8/qtremoteobjects/src/remoteobjects/qconnection_local_backend.cpp"
},
{
"command": "c++ ... /home/kfunk/devel/src/qt5.8/qtremoteobjects/src/remoteobjects/qconnection_tcpip_backend.cpp",
...
bear <build tool>
run-clang-tidy-3.9.py -clang-tidy-binary clang-tidy-3.9 -clang-apply-replacements-binary clang-apply-replacements-3.9 -header-filter='.*' -checks='-*,modernize-use-auto' -fix
...
/home/kfunk/devel/src/qt5.8/qtremoteobjects/src/remoteobjects/qremoteobjectnode.cpp:419:5: warning: use auto when initializing with new to avoid duplicating the type name [modernize-use-auto]
QConnectedReplicaPrivate *rp = new QConnectedReplicaPrivate(name, meta, q);
^
auto
/home/kfunk/devel/src/qt5.8/qtremoteobjects/src/remoteobjects/qremoteobjectnode.cpp:440:9: warning: use auto when initializing with new to avoid duplicating the type name [modernize-use-auto]
QInProcessReplicaPrivate *rp = new QInProcessReplicaPrivate(name, meta, q);
^
auto
...
error: no suitable precompiled header file found in directory '.pch/Qt5RemoteObjects.gch' [clang-diagnostic-error]
error: PCH file built from a different branch ((tags/RELEASE_400/rc1)) than the compiler ((tags/RELEASE_391/rc2)) [clang-diagnostic-error]
% clang-apply-replacements /tmp/tmpIqtp7m
...
Described file '.moc/../../../../../../src/qt5.8/qtremoteobjects/src/remoteobjects/qremoteobjectabstractitemmodelreplica_p.h' doesn't exist. Ignoring...
Described file '.moc/../../../../../../src/qt5.8/qtremoteobjects/src/remoteobjects/qremoteobjectpendingcall.h' doesn't exist. Ignoring...
zsh: segmentation fault  clang-apply-replacements /tmp/tmpIqtp7m

Need help?

Contact Us


12 Comments

26 - Jul - 2017

Jani Mikkonen

26 - Jul - 2017

Kevin Funk

3 - Aug - 2017

MrSparc

19 - May - 2021

Kevin Funk

16 - Jan - 2018

Jeff Trull

17 - Jan - 2018

Kevin Funk

1 - Jul - 2019

martin

3 - Jul - 2019

Kevin Funk

15 - Oct - 2020

Ago

19 - May - 2021

Kevin Funk

26 - Apr - 2021

Ahmad

19 - May - 2021

Kevin Funk