The gcc.dg/analyzer/data-model-4.c and
gcc.dg/analyzer/torture/conftest-1.c fail with recent glibc headers
and succeed with older headers.
The new error message is:
warning: use of possibly-NULL 'f' where non-null expected [CWE-690] [-Wanalyzer-possible-null-argument]
Like similar previous fixes in this area, this patch updates the
testcase so that this warning isn't reported.
2023-05-23 Christophe Lyon <christophe.lyon@linaro.org>
gcc/testsuite/
* gcc.dg/analyzer/data-model-4.c: Exit if fopen returns NULL.
* gcc.dg/analyzer/torture/conftest-1.c: Likewise.
main ()
{
FILE *f = fopen ("conftest.out", "w");
+ if (f == NULL)
+ return 1;
return ferror (f) || fclose (f) != 0;
;
main ()
{
FILE *f = fopen ("conftest.out", "w");
+ if (f == NULL)
+ return 1;
return ferror (f) || fclose (f) != 0;
;