summaryrefslogtreecommitdiff
path: root/gcc/fortran/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/error.c')
-rw-r--r--gcc/fortran/error.c47
1 files changed, 44 insertions, 3 deletions
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index e9308374ac6..dde6a0fb527 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
+#include "coretypes.h"
#include "flags.h"
#include "gfortran.h"
@@ -808,6 +809,8 @@ gfc_notify_std (int std, const char *gmsgid, ...)
{
va_list argp;
bool warning;
+ const char *msg1, *msg2;
+ char *buffer;
warning = ((gfc_option.warn_std & std) != 0) && !inhibit_warnings;
if ((gfc_option.allow_std & std) != 0 && !warning)
@@ -820,11 +823,48 @@ gfc_notify_std (int std, const char *gmsgid, ...)
cur_error_buffer->flag = 1;
cur_error_buffer->index = 0;
- va_start (argp, gmsgid);
if (warning)
- error_print (_("Warning:"), _(gmsgid), argp);
+ msg1 = _("Warning:");
else
- error_print (_("Error:"), _(gmsgid), argp);
+ msg1 = _("Error:");
+
+ switch (std)
+ {
+ case GFC_STD_F2008_TS:
+ msg2 = "TS 29113:";
+ break;
+ case GFC_STD_F2008_OBS:
+ msg2 = _("Fortran 2008 obsolescent feature:");
+ break;
+ case GFC_STD_F2008:
+ msg2 = "Fortran 2008:";
+ break;
+ case GFC_STD_F2003:
+ msg2 = "Fortran 2003:";
+ break;
+ case GFC_STD_GNU:
+ msg2 = _("GNU Extension:");
+ break;
+ case GFC_STD_LEGACY:
+ msg2 = _("Legacy Extension:");
+ break;
+ case GFC_STD_F95_OBS:
+ msg2 = _("Obsolescent feature:");
+ break;
+ case GFC_STD_F95_DEL:
+ msg2 = _("Deleted feature:");
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ buffer = (char *) alloca (strlen (msg1) + strlen (msg2) + 2);
+ strcpy (buffer, msg1);
+ strcat (buffer, " ");
+ strcat (buffer, msg2);
+
+ va_start (argp, gmsgid);
+ error_print (buffer, _(gmsgid), argp);
va_end (argp);
error_char ('\0');
@@ -835,6 +875,7 @@ gfc_notify_std (int std, const char *gmsgid, ...)
warnings++;
else
gfc_increment_error_count();
+ cur_error_buffer->flag = 0;
}
return (warning && !warnings_are_errors) ? SUCCESS : FAILURE;