Repository navigation
Misra.md: a check named for a rule finds what the rule asks - #111
Merged
Merged
Conversation
Five rows named a tool that misses part of the rule, measured against the tools: -Wsign-conversion reports a signed operand that turns unsigned, not the promotion of a uint8_t to int (7.0.5); -Wunused-result only a result marked as FN-10 asks (0.1.2); -Wcomma and readability-isolate-declaration leave out the head of a for loop (8.19.1, 10.0.1); cpplint's runtime/explicit leaves out a conversion operator (15.1.3). Each now says in part, and what review takes. 7.0.5 and 0.1.2 are deviations with their reasons: a cast at every promotion would hide the computation, which T-19 widens where it could overflow, and FN-10 marks only a result that is a mistake to drop. CodingStyle C-4 and the reason in .clang-tidy name the conversion operator beside the constructor.
A run of clang-tidy --fix over several files that include the same header inserts the parentheses there once per file, as MaxMatrix found at eight places. The update note of v0.13.0 now says how to take the second pair out: a second run with readability-redundant-parentheses, whose fix-it does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
docs/Misra.mdof a project now says in part where the tool it names for a rule misses part of it, and what review takes:-Wsign-conversionreports a signed operand that turns unsigned, not the promotion of auint8_ttoint.-Wunused-resultreports only a result marked as FN-10 asks.-Wcommaandreadability-isolate-declarationleave out the head of aforloop.runtime/explicitleaves out a conversion operator; CodingStyle C-4 now names it beside the constructor.7.0.5 and 0.1.2 become deviations with their reasons. A cast at every promotion would hide the computation, which T-19 widens where it could overflow. FN-10 marks only a result that is a mistake to drop.
The update note of v0.13.0 in the CHANGELOG also says how to take out parentheses that
clang-tidy --fixputs in twice. That happens when one run covers several files that include the same header, as at eight places in MaxMatrix.Why
A row that names a check reads as covered, and a project that reports compliance from the matrix would claim more than its tools find.
How it was checked
-Wsign-conversion(GCC and clang) is silent onuint8_t + uint8_tand reportsint16_t + uint32_t.-Wcommamissesi++, j--in aforhead.readability-isolate-declarationmissesint i{0}, j{n}there.operator int().readability-redundant-parentheses --fixtakes((a == b)) && cback to(a == b) && c.tests/check.sh lint docspasses for the Arduino library and with--no-arduino;tests/doc_indent.pypasses.