Example:
#define MACRO(C) if (C) { static int x; .. }
void foo() {
MACRO(0);
}
Differential Revision: https://reviews.llvm.org/D36141
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309799
91177308-0d34-0410-b5e6-
96231b3b80d8
continue;
// Check for false positives
- if (CB->size() > 0 && isInvalidPath(CB, *PM))
+ if (isInvalidPath(CB, *PM))
continue;
// It is good practice to always have a "default" label in a "switch", even
RETURN(1); // no-warning
}
+// Avoid FP when macro argument is known
+void writeSomething(int *x);
+#define MACRO(C) \
+ if (!C) { \
+ static int x; \
+ writeSomething(&x); \
+ }
+void macro2(void) {
+ MACRO(1);
+}