CPP: Fix for explicitly cast expressions.

This commit is contained in:
Geoffrey White
2018-11-14 19:43:24 +00:00
parent 3028e85457
commit d1adc0e3ec
3 changed files with 4 additions and 3 deletions

View File

@@ -4,4 +4,5 @@
| test.c:11:2:11:8 | ... << ... | AV Rule 164: The right-hand operand (here a value is 8) of this shift shall lie between 0 and 7. |
| test.c:18:2:18:9 | ... >> ... | AV Rule 164: The right-hand operand (here a value is -1) of this shift shall lie between 0 and 7. |
| test.c:21:2:21:8 | ... >> ... | AV Rule 164: The right-hand operand (here a value is 8) of this shift shall lie between 0 and 7. |
| test.c:23:2:23:25 | ... >> ... | AV Rule 164: The right-hand operand (here a value is -1) of this shift shall lie between 0 and 31. |
| test.c:23:2:23:25 | ... >> ... | AV Rule 164: The right-hand operand (here a value is -1) of this shift shall lie between 0 and 7. |
| test.c:26:2:26:24 | ... >> ... | AV Rule 164: The right-hand operand (here a value is 8) of this shift shall lie between 0 and 7. |

View File

@@ -23,6 +23,6 @@ void f(unsigned char uc, signed char sc, int i) {
((unsigned char)i) >> -1; // BAD
((unsigned char)i) >> 0;
((unsigned char)i) >> 7;
((unsigned char)i) >> 8; // BAD [NOT DETECTED]
((unsigned char)i) >> 8; // BAD
}