[CPP-434] Squelch alerts for expressions inside macros; try to make Qhelp Jenkins-friendly.

This commit is contained in:
Ziemowit Laski
2019-11-01 15:24:22 -07:00
parent 3e1fd4a737
commit 2bad9394b7
3 changed files with 31 additions and 23 deletions

View File

@@ -121,3 +121,10 @@ int overflow12b(int n) {
// not deleted by gcc or clang
return ((unsigned)(n + 32) <= (unsigned)n? -1: 1); // BAD: n + 32 may overflow
}
#define MACRO(E1, E2) (E1) <= (E2)? -1: 1
int overflow12_macro(int n) {
return MACRO((unsigned)(n + 32), (unsigned)n); // GOOD: inside a macro expansion
}