File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
cpp/common/src/codingstandards/cpp
c/misra/test/rules/RULE-8-13 Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -105,4 +105,8 @@ void test_struct_2(struct S *s) { // NON_COMPLIANT - could be const
105105}
106106
107107void test_no_body (int * p ); // COMPLIANT - no body, so cannot evaluate whether it
108- // should be const
108+ // should be const
109+
110+ void increment (int * p ) { // COMPLIANT
111+ * p ++ = 1 ;
112+ }
Original file line number Diff line number Diff line change @@ -190,6 +190,8 @@ Expr getAnEffect(Expr base) {
190190 or
191191 exists ( PointerDereferenceExpr e | e .getOperand ( ) = base | result = getAnEffect ( e ) )
192192 or
193+ exists ( CrementOperation c | c .getOperand ( ) = base | result = getAnEffect ( c ) )
194+ or
193195 // local alias analysis, assume alias when data flows to derived type (pointer/reference)
194196 // auto ptr = &base;
195197 exists ( VariableAccess va , AddressOfExpr addressOf |
You can’t perform that action at this time.
0 commit comments