On some VxWorks targets, stderr is #defined to a function call, and
this confuses the analyzer in test_1, so we skip the warning. That
appears to reveal a bug in the analyzer, but it doesn't seem to be
what the test was meant to test, so I'm dropping this unintended
feature from this testcase and filing PR124672 with a testcase to
reproduce it elsewhere.
for gcc/testsuite/ChangeLog
* c-c++-common/analyzer/deref-before-check-2.c (test_1):
Drop stderr.
int test_1 (struct st *p)
{
- fprintf (stderr, "str: %s\n", p->str); /* { dg-message "pointer 'p' is dereferenced here" } */
+ printf ("str: %s\n", p->str); /* { dg-message "pointer 'p' is dereferenced here" } */
if (!p) /* { dg-warning "check of 'p' for NULL after already dereferencing it" } */
return -1;
return p->i;