mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 21:41:14 +08:00
re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
2014-10-28 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * gfortran.h (gfc_warning_cmdline): Rename as gfc_warning_now_2. (gfc_error_cmdline): Rename as gfc_error_now_2. * error.c (gfc_diagnostic_build_locus_prefix): Remove trailing space. (gfc_diagnostic_starter): Add space between locus and prefix. (gfc_warning_now_2): Renamed from gfc_warning_cmdline. (gfc_error_now_2): Renamed from gfc_error_cmdline. * scanner.c (add_path_to_list): Use gfc_warning_now_2. (load_line): Likewise. (load_file): Likewise. * options.c (gfc_post_options): Update all renamed functions. From-SVN: r216812
This commit is contained in:
parent
99630555c2
commit
a56abdccae
@ -1,3 +1,17 @@
|
||||
2014-10-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
|
||||
|
||||
PR fortran/44054
|
||||
* gfortran.h (gfc_warning_cmdline): Rename as gfc_warning_now_2.
|
||||
(gfc_error_cmdline): Rename as gfc_error_now_2.
|
||||
* error.c (gfc_diagnostic_build_locus_prefix): Remove trailing space.
|
||||
(gfc_diagnostic_starter): Add space between locus and prefix.
|
||||
(gfc_warning_now_2): Renamed from gfc_warning_cmdline.
|
||||
(gfc_error_now_2): Renamed from gfc_error_cmdline.
|
||||
* scanner.c (add_path_to_list): Use gfc_warning_now_2.
|
||||
(load_line): Likewise.
|
||||
(load_file): Likewise.
|
||||
* options.c (gfc_post_options): Update all renamed functions.
|
||||
|
||||
2014-10-28 Andrew MacLeod <amacleod@redhat.com>
|
||||
|
||||
* f95-lang.c: Adjust include files.
|
||||
|
@ -1004,13 +1004,13 @@ gfc_diagnostic_build_locus_prefix (diagnostic_context *context,
|
||||
s.column = diagnostic->override_column;
|
||||
|
||||
return (s.file == NULL
|
||||
? build_message_string ("%s%s:%s ", locus_cs, progname, locus_ce )
|
||||
? build_message_string ("%s%s:%s", locus_cs, progname, locus_ce )
|
||||
: !strcmp (s.file, N_("<built-in>"))
|
||||
? build_message_string ("%s%s:%s ", locus_cs, s.file, locus_ce)
|
||||
? build_message_string ("%s%s:%s", locus_cs, s.file, locus_ce)
|
||||
: context->show_column
|
||||
? build_message_string ("%s%s:%d:%d:%s ", locus_cs, s.file, s.line,
|
||||
? build_message_string ("%s%s:%d:%d:%s", locus_cs, s.file, s.line,
|
||||
s.column, locus_ce)
|
||||
: build_message_string ("%s%s:%d:%s ", locus_cs, s.file, s.line, locus_ce));
|
||||
: build_message_string ("%s%s:%d:%s", locus_cs, s.file, s.line, locus_ce));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1038,7 +1038,7 @@ gfc_diagnostic_starter (diagnostic_context *context,
|
||||
{
|
||||
/* Otherwise, start again. */
|
||||
pp_clear_output_area(context->printer);
|
||||
pp_set_prefix (context->printer, concat (locus_prefix, prefix, NULL));
|
||||
pp_set_prefix (context->printer, concat (locus_prefix, " ", prefix, NULL));
|
||||
free (prefix);
|
||||
}
|
||||
free (locus_prefix);
|
||||
@ -1052,10 +1052,10 @@ gfc_diagnostic_finalizer (diagnostic_context *context,
|
||||
pp_newline_and_flush (context->printer);
|
||||
}
|
||||
|
||||
/* Give a warning about the command-line. */
|
||||
/* Immediate warning (i.e. do not buffer the warning). */
|
||||
|
||||
bool
|
||||
gfc_warning_cmdline (int opt, const char *gmsgid, ...)
|
||||
gfc_warning_now_2 (int opt, const char *gmsgid, ...)
|
||||
{
|
||||
va_list argp;
|
||||
diagnostic_info diagnostic;
|
||||
@ -1070,11 +1070,10 @@ gfc_warning_cmdline (int opt, const char *gmsgid, ...)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* Give a warning about the command-line. */
|
||||
/* Immediate warning (i.e. do not buffer the warning). */
|
||||
|
||||
bool
|
||||
gfc_warning_cmdline (const char *gmsgid, ...)
|
||||
gfc_warning_now_2 (const char *gmsgid, ...)
|
||||
{
|
||||
va_list argp;
|
||||
diagnostic_info diagnostic;
|
||||
@ -1089,10 +1088,10 @@ gfc_warning_cmdline (const char *gmsgid, ...)
|
||||
}
|
||||
|
||||
|
||||
/* Give an error about the command-line. */
|
||||
/* Immediate error (i.e. do not buffer). */
|
||||
|
||||
void
|
||||
gfc_error_cmdline (const char *gmsgid, ...)
|
||||
gfc_error_now_2 (const char *gmsgid, ...)
|
||||
{
|
||||
va_list argp;
|
||||
diagnostic_info diagnostic;
|
||||
|
@ -2698,15 +2698,15 @@ const char *gfc_print_wide_char (gfc_char_t);
|
||||
|
||||
void gfc_warning (const char *, ...) ATTRIBUTE_GCC_GFC(1,2);
|
||||
void gfc_warning_now (const char *, ...) ATTRIBUTE_GCC_GFC(1,2);
|
||||
bool gfc_warning_cmdline (const char *gmsgid, ...) ATTRIBUTE_GCC_GFC(1,2);
|
||||
bool gfc_warning_cmdline (int opt, const char *gmsgid, ...) ATTRIBUTE_GCC_GFC(2,3);
|
||||
bool gfc_warning_now_2 (const char *gmsgid, ...) ATTRIBUTE_GCC_GFC(1,2);
|
||||
bool gfc_warning_now_2 (int opt, const char *gmsgid, ...) ATTRIBUTE_GCC_GFC(2,3);
|
||||
|
||||
void gfc_clear_warning (void);
|
||||
void gfc_warning_check (void);
|
||||
|
||||
void gfc_error (const char *, ...) ATTRIBUTE_GCC_GFC(1,2);
|
||||
void gfc_error_cmdline (const char *gmsgid, ...) ATTRIBUTE_GCC_GFC(1,2);
|
||||
void gfc_error_now (const char *, ...) ATTRIBUTE_GCC_GFC(1,2);
|
||||
void gfc_error_now_2 (const char *gmsgid, ...) ATTRIBUTE_GCC_GFC(1,2);
|
||||
void gfc_fatal_error (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_GCC_GFC(1,2);
|
||||
void gfc_internal_error (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_GCC_GFC(1,2);
|
||||
void gfc_clear_error (void);
|
||||
|
@ -362,8 +362,8 @@ gfc_post_options (const char **pfilename)
|
||||
if (gfc_current_form == FORM_UNKNOWN)
|
||||
{
|
||||
gfc_current_form = FORM_FREE;
|
||||
gfc_warning_cmdline ("Reading file %qs as free form",
|
||||
(filename[0] == '\0') ? "<stdin>" : filename);
|
||||
gfc_warning_now_2 ("Reading file %qs as free form",
|
||||
(filename[0] == '\0') ? "<stdin>" : filename);
|
||||
}
|
||||
}
|
||||
|
||||
@ -372,10 +372,10 @@ gfc_post_options (const char **pfilename)
|
||||
if (gfc_current_form == FORM_FREE)
|
||||
{
|
||||
if (gfc_option.flag_d_lines == 0)
|
||||
gfc_warning_cmdline ("%<-fd-lines-as-comments%> has no effect "
|
||||
"in free form");
|
||||
gfc_warning_now_2 ("%<-fd-lines-as-comments%> has no effect "
|
||||
"in free form");
|
||||
else if (gfc_option.flag_d_lines == 1)
|
||||
gfc_warning_cmdline ("%<-fd-lines-as-code%> has no effect in free form");
|
||||
gfc_warning_now_2 ("%<-fd-lines-as-code%> has no effect in free form");
|
||||
}
|
||||
|
||||
/* If -pedantic, warn about the use of GNU extensions. */
|
||||
@ -393,21 +393,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_cmdline ("Flag %<-fno-automatic%> overwrites %<-fmax-stack-var-size=%d%>",
|
||||
gfc_option.flag_max_stack_var_size);
|
||||
gfc_warning_now_2 ("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_cmdline ("Flag %<-fno-automatic%> overwrites %<-frecursive%>");
|
||||
gfc_warning_now_2 ("Flag %<-fno-automatic%> overwrites %<-frecursive%>");
|
||||
else if (!gfc_option.flag_automatic && gfc_option.gfc_flag_openmp)
|
||||
gfc_warning_cmdline ("Flag %<-fno-automatic%> overwrites %<-frecursive%> implied by "
|
||||
"%<-fopenmp%>");
|
||||
gfc_warning_now_2 ("Flag %<-fno-automatic%> overwrites %<-frecursive%> implied by "
|
||||
"%<-fopenmp%>");
|
||||
else if (gfc_option.flag_max_stack_var_size != -2
|
||||
&& gfc_option.flag_recursive)
|
||||
gfc_warning_cmdline ("Flag %<-frecursive%> overwrites %<-fmax-stack-var-size=%d%>",
|
||||
gfc_option.flag_max_stack_var_size);
|
||||
gfc_warning_now_2 ("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_cmdline ("Flag %<-fmax-stack-var-size=%d%> overwrites %<-frecursive%> "
|
||||
"implied by %<-fopenmp%>",
|
||||
gfc_warning_now_2 ("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. */
|
||||
|
@ -324,16 +324,16 @@ add_path_to_list (gfc_directorylist **list, const char *path,
|
||||
if (stat (q, &st))
|
||||
{
|
||||
if (errno != ENOENT)
|
||||
gfc_warning_cmdline ("Include directory %qs: %s", path,
|
||||
xstrerror(errno));
|
||||
gfc_warning_now_2 ("Include directory %qs: %s", path,
|
||||
xstrerror(errno));
|
||||
else if (warn)
|
||||
gfc_warning_cmdline (OPT_Wmissing_include_dirs,
|
||||
"Nonexistent include directory %qs", path);
|
||||
gfc_warning_now_2 (OPT_Wmissing_include_dirs,
|
||||
"Nonexistent include directory %qs", path);
|
||||
return;
|
||||
}
|
||||
else if (!S_ISDIR (st.st_mode))
|
||||
{
|
||||
gfc_warning_cmdline ("%qs is not a directory", path);
|
||||
gfc_warning_now_2 ("%qs is not a directory", path);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1476,11 +1476,11 @@ load_line (FILE *input, gfc_char_t **pbuf, int *pbuflen, const int *first_char)
|
||||
&& !seen_printable && seen_ampersand)
|
||||
{
|
||||
if (pedantic)
|
||||
gfc_error_now ("'&' not allowed by itself in line %d",
|
||||
current_line);
|
||||
gfc_error_now_2 ("%<&%> not allowed by itself in line %d",
|
||||
current_line);
|
||||
else
|
||||
gfc_warning_now ("'&' not allowed by itself in line %d",
|
||||
current_line);
|
||||
gfc_warning_now_2 ("%<&%> not allowed by itself in line %d",
|
||||
current_line);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1538,8 +1538,8 @@ load_line (FILE *input, gfc_char_t **pbuf, int *pbuflen, const int *first_char)
|
||||
&& current_line != linenum)
|
||||
{
|
||||
linenum = current_line;
|
||||
gfc_warning_now ("Nonconforming tab character in column %d "
|
||||
"of line %d", i+1, linenum);
|
||||
gfc_warning_now_2 ("Nonconforming tab character in column %d "
|
||||
"of line %d", i+1, linenum);
|
||||
}
|
||||
|
||||
while (i < 6)
|
||||
@ -1922,7 +1922,7 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
|
||||
input = gfc_open_file (realfilename);
|
||||
if (input == NULL)
|
||||
{
|
||||
gfc_error_cmdline ("Can't open file %qs", filename);
|
||||
gfc_error_now_2 ("Can't open file %qs", filename);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user