[tuples] start c_gimple_diagnostics_recursively conversion
Manuel López-Ibáñez
lopezibanez@gmail.com
Tue Jul 24 10:54:00 GMT 2007
On 24/07/07, Aldy Hernandez <aldyh@redhat.com> wrote:
> > Or dg-warning is too stupid to understand you. ;-) If you tell us what
> > you want to match, we can tell you what you need to match it.
>
> I have something as simple as this:
>
> /* { dg-do compile } */
>
> int foo() __attribute__((warn_unused_result));
>
> void
> bar()
> {
> foo(); /* { dg-warning "ignoring return value of" } */
> }
>
> And the log says something like this:
>
> /source/gimple-tuples-branch/gcc/testsuite/gcc.dg/gimple/call3.c: In function 'bar':
> cc1: warning: ignoring return value of 'foo', declared with attribute warn_unused_result
> output is:
> /source/gimple-tuples-branch/gcc/testsuite/gcc.dg/gimple/call3.c: In function 'bar':
> cc1: warning: ignoring return value of 'foo', declared with attribute warn_unused_result
>
> FAIL: gcc.dg/gimple/call3.c (test for warnings, line 8)
> FAIL: gcc.dg/gimple/call3.c (test for excess errors)
> Excess errors:
> cc1: warning: ignoring return value of 'foo', declared with attribute warn_unused_result
>
> ---------------
>
> As we can see, the warning is there. I have no idea why dg-warning can't
> match it. I'm avoiding doing the obvious-- because no good can come of
> debugging dejagnu: it's plain evil.
>
dg-warning expects this output:
/source/gimple-tuples-branch/gcc/testsuite/gcc.dg/gimple/call3.c:8:
warning: ignoring return value of 'foo', declared with attribute
warn_unused_result
How is that warning generated? Are you using warning(0, "ignoring
return value of 'foo', declared with attribute warn_unused_result") ?
If you cannot change the output, then you may have more luck using
/* dg-warning "ignoring return value of" "" { target *-*-* } 0 } */
or if that still fails using:
/* dg-message "warning: ignoring return value of" "" { target *-*-* } 0 } */
Yes, dejagnu is plain evil or maybe it is lacking some love and care. Or both.
Cheers,
Manuel.
More information about the Gcc-patches
mailing list