summaryrefslogtreecommitdiff
path: root/gcc/opts-diagnostic.h
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-26 13:40:53 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-26 13:40:53 +0000
commit3c6a9715a98d0ee9da8bf24324d0a8a4bba990f0 (patch)
treecb4cbcf522a027e78291661bf1d98cb25d1f7585 /gcc/opts-diagnostic.h
parentabdd77b808b58f43030d78aa8ce6ef62d4b8bbbd (diff)
downloadgcc-3c6a9715a98d0ee9da8bf24324d0a8a4bba990f0.tar.gz
* diagnostic.c: Don't include opts.h.
(permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159869 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/opts-diagnostic.h')
-rw-r--r--gcc/opts-diagnostic.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/opts-diagnostic.h b/gcc/opts-diagnostic.h
new file mode 100644
index 00000000000..5d23c71a1f9
--- /dev/null
+++ b/gcc/opts-diagnostic.h
@@ -0,0 +1,25 @@
+/* Command line option handling. Interactions with diagnostics code.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_OPTS_DIAGNOSTIC_H
+#define GCC_OPTS_DIAGNOSTIC_H
+
+extern char *option_name (diagnostic_context *context, int option_index,
+ diagnostic_t orig_diag_kind, diagnostic_t diag_kind);
+#endif