Addresses a problem brought up by Xavier here: http://permalink.gmane.org/gmane.comp.compilers.clang.devel/46163
tl;dr: We get a warning on the following code
void foo(void *p) __attribute__((nonnull(1))) {
if (p == NULL) {} // warning: always equal to false
}…But not this code:
void foo() __attribute__((returns_nonnull));
int main() {
if (foo() == NULL) {} // no warning
}This patch makes us give a warning in the second case.
I know this is existing behavior, but can you quote true and false in this diagnostic, similar to the way true is quoted above?