aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2019-07-24 20:34:03 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2019-07-24 14:34:03 -0600
commitfa5baeedd47e84b36aff8191bfdf86ee03829a4c (patch)
tree555ecd4cee3204df4576e6ad2ed71999246dd69c /gcc/diagnostic.c
parente34616747028ebeb0be867dc6a23682539bfab60 (diff)
downloadgcc-fa5baeedd47e84b36aff8191bfdf86ee03829a4c.zip
gcc-fa5baeedd47e84b36aff8191bfdf86ee03829a4c.tar.gz
gcc-fa5baeedd47e84b36aff8191bfdf86ee03829a4c.tar.bz2
PR driver/80545 - option -Wstringop-overflow not recognized by Fortran
gcc/cp/ChangeLog: PR driver/80545 * decl.c (finish_function): Use lang_mask. gcc/testsuite/ChangeLog: PR driver/80545 * gcc.misc-tests/help.exp: Add tests. * lib/options.exp: Handle C++. gcc/ChangeLog: PR driver/80545 * diagnostic.c (diagnostic_classify_diagnostic): Use lang_mask. (diagnostic_report_diagnostic): Same. * diagnostic.h (diagnostic_context::option_enabled): Add an argument. (diagnostic_context::lang_mask): New data member. * ipa-pure-const.c (suggest_attribute): Use lang_hooks.option_lang_mask (). * opts-common.c (option_enabled): Handle new argument. (get_option_state): Pass an additional argument. * opts.c (print_filtered_help): Print supported languages for unsupported options. Adjust printing of current state. * opts.h (option_enabled): Add argument. * toplev.c (print_switch_values): Use lang_mask. (general_init): Set global_dc->lang_mask. From-SVN: r273771
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 4761b43..96b6fa3 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "edit-context.h"
#include "selftest.h"
#include "selftest-diagnostic.h"
+#include "opts.h"
#ifdef HAVE_TERMIOS_H
# include <termios.h>
@@ -696,6 +697,7 @@ diagnostic_classify_diagnostic (diagnostic_context *context,
if (old_kind == DK_UNSPECIFIED)
{
old_kind = !context->option_enabled (option_index,
+ context->lang_mask,
context->option_state)
? DK_IGNORED : (context->warning_as_error_requested
? DK_ERROR : DK_WARNING);
@@ -957,6 +959,7 @@ diagnostic_report_diagnostic (diagnostic_context *context,
/* This tests if the user provided the appropriate -Wfoo or
-Wno-foo option. */
if (! context->option_enabled (diagnostic->option_index,
+ context->lang_mask,
context->option_state))
return false;