aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFritz Reese <fritzoreese@gmail.com>2016-11-02 14:46:33 +0000
committerFritz Reese <foreese@gcc.gnu.org>2016-11-02 14:46:33 +0000
commiteab1ee22545ddc53bbe25ab6c4140f29a8879891 (patch)
tree615139715669daed8aa9f8ae9cb12a7714708950
parent5304d04437ac683b9a4c8207728db70774560222 (diff)
downloadgcc-eab1ee22545ddc53bbe25ab6c4140f29a8879891.zip
gcc-eab1ee22545ddc53bbe25ab6c4140f29a8879891.tar.gz
gcc-eab1ee22545ddc53bbe25ab6c4140f29a8879891.tar.bz2
Allow warning flags to associate through gfc_error.
gcc/fortran/ * gfortran.h (gfc_error): New declaration for gfc_error with 'opt'. * error.c (gfc_error): Add optional 'opt' argument. * error.c (gfc_notify_std): Call fully-qualified gfc_error. From-SVN: r241794
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/error.c20
-rw-r--r--gcc/fortran/gfortran.h1
3 files changed, 22 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index fd51989..b92928c 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2016-11-02 Fritz Reese <fritzoreese@gmail.com>
+
+ * gfortran.h (gfc_error): New declaration for gfc_error with 'opt'.
+ * error.c (gfc_error): Add optional 'opt' argument.
+ * error.c (gfc_notify_std): Call fully-qualified gfc_error.
+
2016-11-01 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/78178
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index fe91419..0fd8a4e 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -67,7 +67,7 @@ gfc_push_suppress_errors (void)
}
static void
-gfc_error (const char *gmsgid, va_list ap) ATTRIBUTE_GCC_GFC(1,0);
+gfc_error (int opt, const char *gmsgid, va_list ap) ATTRIBUTE_GCC_GFC(2,0);
static bool
gfc_warning (int opt, const char *gmsgid, va_list ap) ATTRIBUTE_GCC_GFC(2,0);
@@ -902,7 +902,7 @@ gfc_notify_std (int std, const char *gmsgid, ...)
if (warning)
gfc_warning (0, buffer, argp);
else
- gfc_error (buffer, argp);
+ gfc_error (0, buffer, argp);
va_end (argp);
return (warning && !warnings_are_errors) ? true : false;
@@ -1233,7 +1233,7 @@ gfc_warning_check (void)
/* Issue an error. */
static void
-gfc_error (const char *gmsgid, va_list ap)
+gfc_error (int opt, const char *gmsgid, va_list ap)
{
va_list argp;
va_copy (argp, ap);
@@ -1241,7 +1241,7 @@ gfc_error (const char *gmsgid, va_list ap)
if (warnings_not_errors)
{
- gfc_warning (/*opt=*/0, gmsgid, argp);
+ gfc_warning (opt, gmsgid, argp);
va_end (argp);
return;
}
@@ -1289,11 +1289,21 @@ gfc_error (const char *gmsgid, va_list ap)
void
+gfc_error (int opt, const char *gmsgid, ...)
+{
+ va_list argp;
+ va_start (argp, gmsgid);
+ gfc_error (opt, gmsgid, argp);
+ va_end (argp);
+}
+
+
+void
gfc_error (const char *gmsgid, ...)
{
va_list argp;
va_start (argp, gmsgid);
- gfc_error (gmsgid, argp);
+ gfc_error (0, gmsgid, argp);
va_end (argp);
}
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index ea4437c..b559e8a 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2730,6 +2730,7 @@ bool gfc_warning_now_at (location_t loc, int opt, const char *gmsgid, ...)
void gfc_clear_warning (void);
void gfc_warning_check (void);
+void gfc_error (int opt, const char *, ...) ATTRIBUTE_GCC_GFC(2,3);
void gfc_error (const char *, ...) ATTRIBUTE_GCC_GFC(1,2);
void gfc_error_now (const char *, ...) ATTRIBUTE_GCC_GFC(1,2);
void gfc_fatal_error (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_GCC_GFC(1,2);