diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2014-08-20 12:48:16 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2014-08-20 12:48:16 +0000 |
commit | 3ba421e8becbd17526a88ec76226d7213b96af14 (patch) | |
tree | 3164cedfb7fb422a18eb3305ee3af6daa65943fa /gcc/diagnostic.c | |
parent | c84d88e45c50cadf07edfaac07b174490d48bbde (diff) | |
download | gcc-3ba421e8becbd17526a88ec76226d7213b96af14.zip gcc-3ba421e8becbd17526a88ec76226d7213b96af14.tar.gz gcc-3ba421e8becbd17526a88ec76226d7213b96af14.tar.bz2 |
re PR c/59304 (#pragma diagnostic pop after warning fails for options unspecified in the command-line and disabled by default)
gcc/ChangeLog:
2014-08-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/59304
* opts-common.c (set_option): Call diagnostic_classify_diagnostic
before setting the option.
* diagnostic.c (diagnostic_classify_diagnostic): Record
command-line status.
gcc/testsuite/ChangeLog:
2014-08-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/59304
* gcc.dg/pr59304.c: New test.
From-SVN: r214221
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r-- | gcc/diagnostic.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 2226821..6244721 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -584,6 +584,15 @@ diagnostic_classify_diagnostic (diagnostic_context *context, { int i; + /* Record the command-line status, so we can reset it back on DK_POP. */ + if (old_kind == DK_UNSPECIFIED) + { + old_kind = context->option_enabled (option_index, + context->option_state) + ? DK_WARNING : DK_IGNORED; + context->classify_diagnostic[option_index] = old_kind; + } + for (i = context->n_classification_history - 1; i >= 0; i --) if (context->classification_history[i].option == option_index) { |