File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ import codingstandards.cpp.alertreporting.HoldsForAllCopies
2222
2323class NonConstPointerVariableCandidate extends Variable {
2424 NonConstPointerVariableCandidate ( ) {
25+ // Ignore variables in functions that use ASM commands
26+ not exists ( AsmStmt a | a .getEnclosingFunction ( ) = this .( LocalScopeVariable ) .getFunction ( ) ) and
2527 // Avoid elements in macro expansions, as they cannot be equated across copies
2628 not this .isInMacroExpansion ( ) and
2729 exists ( PointerOrArrayType type |
Original file line number Diff line number Diff line change @@ -75,4 +75,13 @@ char *f16(char *p1) { // NON_COMPLIANT
7575int f17 (char * p1 ) { // NON_COMPLIANT
7676 p1 ++ ;
7777 return 0 ;
78+ }
79+
80+ #include <stdint.h>
81+
82+ int16_t
83+ test_r (int16_t * value ) { // COMPLIANT - ignored because of the use of ASM
84+ int16_t result ;
85+ __asm__("movb %bh (%eax)" );
86+ return result ;
7887}
You can’t perform that action at this time.
0 commit comments