Code Monkey home page Code Monkey logo

devel_machine's Introduction

OpenLab on static and dynamic code analysis

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, run alias clang=~/bin/clang and alias 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-31
    • static_exaples/ takes examples from clang static analyzer and cppcheck examples
    • format/ shows demo on clang-format tool, but it is better as live demo
    • tidy/ shows modernize checks of clang-tidy, running notes are first line of the files
    • dynamic/ compares valgrind with clang sanitizers, running notes are again the first line of code

Sources

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.

Final thoughts

  • Use clang. It has no disadvantage to gcc, but better compilation messages. And it will be the future (better development)
  • Search for integration of clang-tidy and clang-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 has clang-tidy integrated since 2017, clang-format has to be added manualy; QtCreator has clang-format plugin, but clang-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 know vagrind, 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

Note

Feel free to change anything in the tools. If you have some suggestions, write me :).

devel_machine's People

Contributors

bender250 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.