Add a new clang-tidy module for safety-critical checks.
Include a check for inline assembler.
Differential D29267
[clang-tidy] safety-no-assembler jbcoe on Jan 29 2017, 4:05 PM. Authored by
Details Add a new clang-tidy module for safety-critical checks. Include a check for inline assembler.
Diff Detail
Event TimelineComment Actions Standard you linked mentions portability as the reason inline assembler should be avoided. Should it really be named 'safety'? Comment Actions High Integrity C++ is often used as a standard for safety-critical systems. High Integrity C++ requires no assembler due to portability issues. Not my choice of wording.
Comment Actions I wonder whether there's a compiler diagnostic for this purpose. Compiler diagnostics are more efficient at reaching users and should be preferred where they are appropriate (this seems like one of such cases). Comment Actions Improve diagnostic message. Find other sorts of inline assembler. Minor fixes for other review comments. Comment Actions out of curiousity: this is not specifically patch related, but dunno where to ask else. e.g. could it be possible to commit the std::vector<bool> thing, even though temlate parameters dont work right now. this could be added as a known limitation. Comment Actions @JonasToth My main intention with this patch is to provide such a starting point. A few people have mentioned that they'd be keen to contribute checks. Comment Actions @alexfh Can we defer moving this to a compiler diagnostic? I'm keen to get a target in place for people to write more safety checks. Comment Actions +1 from me :) Comment Actions I don't think a compiler diagnostic would be appropriate for this. It would be incredibly chatty for people who do need to use the assembler.
Comment Actions There were review comments still outstanding when you commit the patch. Can you please address those post-commit? |