File tree Expand file tree Collapse file tree
Published Standards/MISRA C 2012
SciTools' Recommended Checks/RECOMMENDED_05 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ int main() {
2323 return 0 ;
2424}
2525
26- // #4916: an 8-bit destination is not wider than a 16/32-bit operand. Earlier the
26+ // An 8-bit destination is not wider than a 16/32-bit operand. Earlier the
2727// size comparison was done on strings ("32" < "8"), so any wider operand was
2828// treated as narrower and these were flagged.
2929void narrow_destination (void ) {
Original file line number Diff line number Diff line change 11#include <stdint.h>
22#include <string.h>
33
4- // #4916: rule 10.8 only applies to composite expressions. A cast of a single
4+ // Rule 10.8 only applies to composite expressions. A cast of a single
55// object, constant, function call or array element is compliant.
66#define OUTPUT_BITS (256)
77void non_composite_operands (const uint8_t * data , uint32_t index ) {
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ int main() {
99 enum etag { A , B } e = ( enum etag ) p ; // UndCC_FalseNeg
1010}
1111
12- // #4916: no pointer/integer conversion occurs in these. The check used to read
12+ // No pointer/integer conversion occurs in these. The check used to read
1313// the declared type of an operand while ignoring '&' (address-of) and the
1414// subscript operator.
1515void no_conversion (void ) {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ int main() {
3030 uint32_t arr3 [2 ] = {(uint32_t )(x ++ ), 5 }; // UndCC_Violation
3131}
3232
33- // #4916: assigning to an array element is not an initializer list.
33+ // Assigning to an array element is not an initializer list.
3434uint32_t make_value (void ) { return 7 ; }
3535void element_assignment (void ) {
3636 uint8_t message [20 ];
Original file line number Diff line number Diff line change 22#include <stddef.h>
33#include <stdbool.h>
44
5- // #4916: the rule applies to C if/iteration statements, not preprocessor #if.
5+ // The rule applies to C if/iteration statements, not preprocessor #if.
66#if ARCH == 7 // UndCC_Valid
77#define A 1
88#elif !defined B && !defined C // UndCC_Valid
Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ def check(check, file):
286286 if not defineRef:
287287 # No definition and no declaration in the project: a library
288288 # function whose header isn't part of the project, not an implicit
289- # declaration. Real implicit declarations are caught above. (#4916)
289+ # declaration. Real implicit declarations are caught above.
290290 continue
291291
292292 if defineRef.file().longname() == call.file().longname() and not declareReferences:
Original file line number Diff line number Diff line change 11#include "string_lib.h"
22
3- // #4916: memset is declared in a header but a fortified library macro redirects
3+ // memset is declared in a header but a fortified library macro redirects
44// the call to compiler builtins (__builtin___memset_chk, __builtin_object_size).
55// Those are compiler intrinsics, not implicit declarations.
66void test_fortified_memset ( void ) {
You can’t perform that action at this time.
0 commit comments