-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 <nvach...@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; }
wc.p
Description: Binary data