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]

FDO usage: -Wcoverage-mismatch should not ignore -Wno-error


-Wcoverage-mismatch is enabled by default, and the warning is promoted
to error by default. However in the current implementation -Wno-error
can not demote the error back to warning. The patch was ported from
one contributed by Neil.

OK for trunk after regression testing?


2011-04-18  Neil Vachharajani  <nvachhar@gmail.com>

    * flags.c:  New flag variable.
    * opts.c (common_handle_options): Set flag_werror_set.
    * opts-global.c (decode_options): Delay Werror decision
    for Wcoverage-mismatch util after options are parsed.

The following test case can be added, but the test harness does not
like the extra warnings -- how can they be pruned?

Thanks,

David

/* { dg-options "-O2 -Wcoverage-mismatch -Wno-error" } */

int __attribute__((noinline)) bar (void)
{
}

#ifdef _PROFILE_USE
int foo (int i)
{
  if (i)
    bar ();
  else
   bar ();
  return 0;
}
#else
int foo (int i)
{
  if (i)
    bar ();
  return 0;
}
#endif

int main(int argc, char **argv)
{
  foo (argc);
  return 0;
}

Attachment: wc.p
Description: Binary data


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