aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/options.c
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2014-08-15 15:10:15 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2014-08-15 15:10:15 +0000
commit8e54f6d3bac9f2e2626e4a1496e01a243d91b9d0 (patch)
treeff48278d43446ffb9145fbbac3289b0d898cacfa /gcc/fortran/options.c
parent363785f63edd6a56427b6aa3f256ffac9a2d376d (diff)
downloadgcc-8e54f6d3bac9f2e2626e4a1496e01a243d91b9d0.zip
gcc-8e54f6d3bac9f2e2626e4a1496e01a243d91b9d0.tar.gz
gcc-8e54f6d3bac9f2e2626e4a1496e01a243d91b9d0.tar.bz2
re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
2014-08-15 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 gcc/ * diagnostic.c (build_message_string): Make it extern. * diagnostic.h (build_message_string): Make it extern. c-family/ * c-format.c: Handle Fortran flags. fortran/ * gfortran.h: Define GCC_DIAG_STYLE. (gfc_diagnostics_init,gfc_warning_cmdline): Declare. * trans-array.c: Include gfortran.h before diagnostic-core.h. * trans-expr.c: Likewise. * trans-openmp.c: Likewise. * trans-const.c: Likewise. * trans.c: Likewise. * trans-types.c: Likewise. * f95-lang.c: Likewise. * trans-decl.c: Likewise. * trans-io.c: Likewise. * trans-intrinsic.c: Likewise. * error.c: Include diagnostic.h and diagnostic-color.h. (gfc_diagnostic_build_prefix): New. (gfc_diagnostic_starter): New. (gfc_diagnostic_finalizer): New. (gfc_warning_cmdline): New. (gfc_diagnostics_init): New. * gfc-diagnostic.def: New. * options.c (gfc_init_options): Call gfc_diagnostics_init. (gfc_post_options): Use gfc_warning_cmdline. From-SVN: r214024
Diffstat (limited to 'gcc/fortran/options.c')
-rw-r--r--gcc/fortran/options.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index e4931f0..508a01c 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -173,6 +173,7 @@ gfc_init_options (unsigned int decoded_options_count,
/* Initialize cpp-related options. */
gfc_cpp_init_options (decoded_options_count, decoded_options);
+ gfc_diagnostics_init ();
}
@@ -352,8 +353,8 @@ gfc_post_options (const char **pfilename)
if (gfc_current_form == FORM_UNKNOWN)
{
gfc_current_form = FORM_FREE;
- gfc_warning_now ("Reading file '%s' as free form",
- (filename[0] == '\0') ? "<stdin>" : filename);
+ gfc_warning_cmdline ("Reading file %qs as free form",
+ (filename[0] == '\0') ? "<stdin>" : filename);
}
}
@@ -362,10 +363,10 @@ gfc_post_options (const char **pfilename)
if (gfc_current_form == FORM_FREE)
{
if (gfc_option.flag_d_lines == 0)
- gfc_warning_now ("'-fd-lines-as-comments' has no effect "
- "in free form");
+ gfc_warning_cmdline ("%<-fd-lines-as-comments%> has no effect "
+ "in free form");
else if (gfc_option.flag_d_lines == 1)
- gfc_warning_now ("'-fd-lines-as-code' has no effect in free form");
+ gfc_warning_cmdline ("%<-fd-lines-as-code%> has no effect in free form");
}
/* If -pedantic, warn about the use of GNU extensions. */
@@ -383,21 +384,21 @@ gfc_post_options (const char **pfilename)
if (!gfc_option.flag_automatic && gfc_option.flag_max_stack_var_size != -2
&& gfc_option.flag_max_stack_var_size != 0)
- gfc_warning_now ("Flag -fno-automatic overwrites -fmax-stack-var-size=%d",
- gfc_option.flag_max_stack_var_size);
+ gfc_warning_cmdline ("Flag %<-fno-automatic%> overwrites %<-fmax-stack-var-size=%d%>",
+ gfc_option.flag_max_stack_var_size);
else if (!gfc_option.flag_automatic && gfc_option.flag_recursive)
- gfc_warning_now ("Flag -fno-automatic overwrites -frecursive");
+ gfc_warning_cmdline ("Flag %<-fno-automatic%> overwrites %<-frecursive%>");
else if (!gfc_option.flag_automatic && gfc_option.gfc_flag_openmp)
- gfc_warning_now ("Flag -fno-automatic overwrites -frecursive implied by "
- "-fopenmp");
+ gfc_warning_cmdline ("Flag %<-fno-automatic%> overwrites %<-frecursive%> implied by "
+ "%<-fopenmp%>");
else if (gfc_option.flag_max_stack_var_size != -2
&& gfc_option.flag_recursive)
- gfc_warning_now ("Flag -frecursive overwrites -fmax-stack-var-size=%d",
- gfc_option.flag_max_stack_var_size);
+ gfc_warning_cmdline ("Flag %<-frecursive%> overwrites %<-fmax-stack-var-size=%d%>",
+ gfc_option.flag_max_stack_var_size);
else if (gfc_option.flag_max_stack_var_size != -2
&& gfc_option.gfc_flag_openmp)
- gfc_warning_now ("Flag -fmax-stack-var-size=%d overwrites -frecursive "
- "implied by -fopenmp",
+ gfc_warning_cmdline ("Flag %<-fmax-stack-var-size=%d%> overwrites %<-frecursive%> "
+ "implied by %<-fopenmp%>",
gfc_option.flag_max_stack_var_size);
/* Implement -frecursive as -fmax-stack-var-size=-1. */