Software Engineering Institute Makes CERT C++ Coding Standard Freely Available
21–27 of 27 posts
Re: Software Engineering Institute Makes CERT C++ Coding Standard Freely Available
#22Earlier quoted context omitted.
I thought there was a checker (based on clang) included by the CPP Core Guidelines [0], but I'm not seeing it there currently. Must have been external. I know I saw a tool that provided partial support, at least for GSL [1] (MS's library support of the the CPP Core Guidelines). [0] https://github.com/isocpp/CppCoreGuidelines [1] https://github.com/microsoft/gsl/
Maybe I'm misunderstanding your reply, but the GSL is the checker. It adds header constructs that create compile time errors based on bad practices. The whole point is that there is no need for an external tool.
Well it's a bunch of headers declaring useful types and functions. If you don't use them the compiler won't complain and nothing is checked. I think the OP means something like static analysis.
I found a note in my C++14/17 TODO list where I typed 'clang-tidy might be able to give warnings for pre-c++14 constructs etc, see https://reviews.llvm.org/diffusion/L/browse/clang-tools-extr.... Don't have time now to figure out what that is, but it's probably what the OP is after.
Re: Software Engineering Institute Makes CERT C++ Coding Standard Freely Available
#23To anyone experienced with CERT C++: are there rules in the standard that are critical for secure code, but not easy to discover without extensive experience? For instance, I went through the I/O section, and most of the rules seem quite intuitive even to a novice C++ programmer like myself.
Some recommendations seem little bit like "don't make mistakes" but still I like it.
Re: Software Engineering Institute Makes CERT C++ Coding Standard Freely Available
#24It would be great to see such elaborate guidelines to be accompanied with an integration into a linting tool, such as clang-tidy.
I thought there was a checker (based on clang) included by the CPP Core Guidelines [0], but I'm not seeing it there currently. Must have been external. I know I saw a tool that provided partial support, at least for GSL [1] (MS's library support of the the CPP Core Guidelines). [0] https://github.com/isocpp/CppCoreGuidelines [1] https://github.com/microsoft/gsl/
Re: Software Engineering Institute Makes CERT C++ Coding Standard Freely Available
#25To anyone experienced with CERT C++: are there rules in the standard that are critical for secure code, but not easy to discover without extensive experience? For instance, I went through the I/O section, and most of the rules seem quite intuitive even to a novice C++ programmer like myself.
I'm currently working on a system that had no locking order defined (and no any other proper way to prevent or handle deadlocks) -- and looking at the face of my colleagues when I announced that, a good proportion (maybe even the majority) never heard about that kind of stuff before (and they typically have been programming for >5 years) It disturbed me a little because this is the kind of stuff you learn in school,…
Those that treat it like a craft aim to understand what they are doing, how to do things better.
Those that treat it like "just a job" or a means to an end don't want to know or learn anything beyond what is immediately required to do the task.
An example could be using "git push --force" if git push returns with errors
Re: Software Engineering Institute Makes CERT C++ Coding Standard Freely Available
#26I feel like roller coasters started because people wanted to go fast, and this crazy death contraption was the only way how. Subsequently, ride operators, in order to avoid the death of their patrons, advised them not to stick their limbs outside of the car. Unfortunately, this mechanism only reduced injuries, but far from eliminated them. Not only do accidents occur because of the actions of the riders themselves, but ride operators can pose introduce risk not only by malice, but negligence. In extremely rare cases, riders can be injured by compiler failures.
Roller coaster operators soon learned that these contraptions were fundamentally unsafe, and the only way to induce safety was if the systems which drove the coaster had safety as a fundamental concern. Therefore they introduced these things like "PLCs" -- a type of computer to make sure the operators could only do so much to endanger the riders. In addition, by following the basic rules of physics at build time of the coaster they further increased safety. Since people have stopped building coasters that relied on the rider's healthy sense of caution, and the operator's awareness of safety, they've become one of the safest ways to enjoy oneself. Or at least this is how I was hoping the story went.
Re: Software Engineering Institute Makes CERT C++ Coding Standard Freely Available
#27Earlier quoted context omitted.
I've not read through the CERT C++ rules (yet), but I highly recommend reading "Secure Coding in C and C++" [0]. Expectedly, there's a good discussion on bounds checking. But, nearly half the book is dedicated to integer underflow/overflow (and signed/unsigned) issues (which most devs either ignore or are oblivious to). It's not a panacea, but if you're write C/C++ without thinking about security and how things can g…
I haven't read the book. What's the gist of the recommendations for addressing those issues? SaferCPlusPlus addresses the signed/unsigned issue by providing compatible substitutes[1] for "int" and "size_t" that automatically handle it. And it addresses the integer underflow/overflow issue by recommending another compatible "int" substitute[2] and introducing the concept (but not yet the implementation) of "quarantine…