aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-opts.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2010-05-26 14:40:53 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2010-05-26 14:40:53 +0100
commit5f0f4a3bc5e8f25e586b6983d6c8138a89aa030e (patch)
treecb4cbcf522a027e78291661bf1d98cb25d1f7585 /gcc/c-opts.c
parentf024f85d3d72a196f4612ad97b9d422dfdbb2da5 (diff)
downloadgcc-5f0f4a3bc5e8f25e586b6983d6c8138a89aa030e.zip
gcc-5f0f4a3bc5e8f25e586b6983d6c8138a89aa030e.tar.gz
gcc-5f0f4a3bc5e8f25e586b6983d6c8138a89aa030e.tar.bz2
diagnostic.c: Don't include opts.h.
* 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. From-SVN: r159869
Diffstat (limited to 'gcc/c-opts.c')
-rw-r--r--gcc/c-opts.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index fb2b8e2..d83045b 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -304,6 +304,8 @@ c_common_init_options (unsigned int argc, const char **argv)
diagnostic_prefixing_rule (global_dc) = DIAGNOSTICS_SHOW_PREFIX_ONCE;
}
+ global_dc->opt_permissive = OPT_fpermissive;
+
parse_in = cpp_create_reader (c_dialect_cxx () ? CLK_GNUCXX: CLK_GNUC89,
ident_hash, line_table);
cb = cpp_get_callbacks (parse_in);
@@ -848,7 +850,7 @@ c_common_handle_option (size_t scode, const char *arg, int value,
break;
case OPT_fpermissive:
- flag_permissive = value;
+ global_dc->permissive = flag_permissive = value;
break;
case OPT_fpreprocessed: