[bug] notice we do not support some versions of `assert`

Summary:
Ran into this issue on Debian Testing, in which assert.h is probably different
due to a more recent toolchain. Without this change I get the following CFG
for `assert(e)`:

```
start
|-> prune (e) -> join
|-> prune (!e) -> __infer_fail("ASSERTION_FAILURE") -> exit
```

Notice that the first branch does not get to the exit, so infer must think that
the assertion is *always* violated, and reports `error: ASSERTION_FAILURE`.
This is broken.

Reviewed By: dulmarod

Differential Revision: D7067822

fbshipit-source-id: a2bf5ac
master
Jules Villard 7 years ago committed by Facebook Github Bot
parent bb8ba0e7a4
commit c2c9c94d5e

@ -7,6 +7,9 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
// TODO: remove this #define, it's here to get a specific version of
// [assert], as others may confuse the clang frontend (t26324545)
#define __STRICT_ANSI__
#include <assert.h> #include <assert.h>
// We should report here no NPE, but also we should report div0 to show that we // We should report here no NPE, but also we should report div0 to show that we

@ -7,6 +7,9 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
// TODO: remove this #define, it's here to get a specific version of
// [assert], as others may confuse the clang frontend (t26324545)
#define __STRICT_ANSI__
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>

Loading…
Cancel
Save