Last time I set up such a system was for a course several years ago, I don’t know what linters are popular these days. Flint used to be pretty good but it’s no longer maintained. Back then I set up a combination of cppcheck, clang with almost every optional warning, and clang-tidy for formatting. clang-analyze and cppcheck will compliment each other nicely but you do need to play around with their configuration to make informed decisions about conflicting advice every now and then.
Microsoft’s compiler does have warnings about certain risky uses of raw pointers, so using MSVC may be a good idea for safe programming until clang and g++ catch up. On the other hand, MSVC++ is behind on certain other C++ features, so you’ll have to weigh your options here.
There isn’t much documentation I can find on the topic of setting up a linter to enforce modern memory management. Most people asking for information about it seem to get responses from C++ experts telling them raw pointers are fine for and that you shouldn’t be scared of them, but I disagree.
Sadly, no tooling I know of has sufficient detection of pointer footguns (such as smart pointers made out of smart pointers leading to double frees).
Is there a way to disable the old c++ features? Or some kind of linter that points them out and suggests the new ways?
deleted by creator
Any suggestions for linter?
Last time I set up such a system was for a course several years ago, I don’t know what linters are popular these days. Flint used to be pretty good but it’s no longer maintained. Back then I set up a combination of cppcheck, clang with almost every optional warning, and clang-tidy for formatting. clang-analyze and cppcheck will compliment each other nicely but you do need to play around with their configuration to make informed decisions about conflicting advice every now and then.
Microsoft’s compiler does have warnings about certain risky uses of raw pointers, so using MSVC may be a good idea for safe programming until clang and g++ catch up. On the other hand, MSVC++ is behind on certain other C++ features, so you’ll have to weigh your options here.
There isn’t much documentation I can find on the topic of setting up a linter to enforce modern memory management. Most people asking for information about it seem to get responses from C++ experts telling them raw pointers are fine for and that you shouldn’t be scared of them, but I disagree.
Sadly, no tooling I know of has sufficient detection of pointer footguns (such as smart pointers made out of smart pointers leading to double frees).
deleted by creator