This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tuples] start c_gimple_diagnostics_recursively conversion


> 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.

Aldy


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]