]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: analyzer: drop stderr from deref-before-check-2.c
authorAlexandre Oliva <oliva@adacore.com>
Tue, 31 Mar 2026 00:57:34 +0000 (21:57 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Tue, 31 Mar 2026 00:57:34 +0000 (21:57 -0300)
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.

gcc/testsuite/c-c++-common/analyzer/deref-before-check-2.c

index c0409c42d8982423744fe1cabb23e26c3fffa2bc..981635af72799964a77ff329430d0380c83562ab 100644 (file)
@@ -8,7 +8,7 @@ struct st
 
 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;