Repository contains following files:
-
Vagrantfile
for building virtual machine for modern C++ development- Based on modern Fedora with all developer tools
bootstrap.sh
builds current LLVM toolchain- image uses default sudo-er user vagrant with password vagrant (you can install anything using
sudo dnf install
) - the toolchain is located in
/home/vagrant/bin
, if you want to use current clang instead Fedora's installed clang, runalias clang=~/bin/clang
andalias clang++=~/bin/clang++
. Other tools are used from LLVM toolchain
-
folder
vm-files
contains following examples:zune_bug.c
was mean as goal for static analyzers, but both failed to catch it. it is bug that disabled Microsoft Zune devices on 2012-21-31static_exaples/
takes examples from clang static analyzer and cppcheck examplesformat/
shows demo onclang-format
tool, but it is better as live demotidy/
shows modernize checks ofclang-tidy
, running notes are first line of the filesdynamic/
comparesvalgrind
with clang sanitizers, running notes are again the first line of code
Please note I used following sources. I made the OpenLab to learn myself the tools, if I was not succesful to learn you these tools, the talks I have seen wil do so.
- Pacific++ 2017: Chandler Carruth "LLVM: A Modern, Open C++ Toolchain" - this was the main source
- Tools from the C++ Ecosystem to save a leg - Anastasia Kazakova - Meeting C++ 2017
- CppCon 2017: Kostya Serebryany "Fuzz or lose: why and how to make fuzzing a standard practice for C++"
- Use
clang
. It has no disadvantage togcc
, but better compilation messages. And it will be the future (better development) - Search for integration of
clang-tidy
andclang-format
into your IDE. Else you won't use the tools. Once you start using them, it will motivate you to read about available checks. (CLion hasclang-tidy
integrated since 2017,clang-format
has to be added manualy; QtCreator has clang-format plugin, butclang-tidy
is not available as is clang static analyser is) - Use dynamic analysis for debugging! If you never used
valgrind
, start with it. If you knowvagrind
, try to substitute it with clang sanitizers, they are stronger (stack check, undefined behaviour sanitizer). - Write tests, or you won't be able to run dynamic analysis
Feel free to change anything in the tools. If you have some suggestions, write me :).