public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38444]  New: poor error message
@ 2008-12-08 14:30 jv244 at cam dot ac dot uk
  2008-12-08 18:25 ` [Bug fortran/38444] " kargl at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-12-08 14:30 UTC (permalink / raw)
  To: gcc-bugs

IMPLICIT NONE
INTEGER :: a,b,c,d,e,f,g,h,a
a=0 ; b=0 ; c=0 ; d=0 ; e=0 ; f=0 ; g=0 ; h=0
END

this typo leads to 9 error messages.


-- 
           Summary: poor error message
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38444


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/38444] poor error message
  2008-12-08 14:30 [Bug fortran/38444] New: poor error message jv244 at cam dot ac dot uk
@ 2008-12-08 18:25 ` kargl at gcc dot gnu dot org
  2008-12-08 18:41 ` jv244 at cam dot ac dot uk
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: kargl at gcc dot gnu dot org @ 2008-12-08 18:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from kargl at gcc dot gnu dot org  2008-12-08 18:24 -------
Yeah, this has always bothered me.  I typically use -fmax-errors=1 when
developing new code because of the run-on errors for simple mistakes.
This fixes the excessive errors in this case.

Index: symbol.c
===================================================================
--- symbol.c    (revision 142481)
+++ symbol.c    (working copy)
@@ -1559,7 +1559,8 @@ gfc_add_type (gfc_symbol *sym, gfc_types
          || gfc_notification_std (GFC_STD_GNU) == ERROR
          || pedantic)
        {
-         gfc_error (msg, sym->name, where, gfc_basic_typename (sym->ts.type));
+         gfc_fatal_error (msg, sym->name, where,
+                          gfc_basic_typename (sym->ts.type));
          return FAILURE;
        }
       if (gfc_notify_std (GFC_STD_GNU, msg, sym->name, where,


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38444


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/38444] poor error message
  2008-12-08 14:30 [Bug fortran/38444] New: poor error message jv244 at cam dot ac dot uk
  2008-12-08 18:25 ` [Bug fortran/38444] " kargl at gcc dot gnu dot org
@ 2008-12-08 18:41 ` jv244 at cam dot ac dot uk
  2008-12-08 19:33 ` kargl at gcc dot gnu dot org
  2009-03-29  8:31 ` [Bug fortran/38444] Poor recovery from error fxcoudert at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-12-08 18:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jv244 at cam dot ac dot uk  2008-12-08 18:39 -------
(In reply to comment #1)
> -         gfc_error (msg, sym->name, where, gfc_basic_typename (sym->ts.type));
> +         gfc_fatal_error (msg, sym->name, where,
> +                          gfc_basic_typename (sym->ts.type));

That produces too few error messages. I.e. 

IMPLICIT NONE
INTEGER :: a,b,c,d,e,f,g,h,a
a=0 ; b=0 ; c=0 ; d=0 ; e=0 ; f=0 ; g=0 ; h=0; i=0
END

should produce (like NAG f95, ifort) two errors only.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38444


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/38444] poor error message
  2008-12-08 14:30 [Bug fortran/38444] New: poor error message jv244 at cam dot ac dot uk
  2008-12-08 18:25 ` [Bug fortran/38444] " kargl at gcc dot gnu dot org
  2008-12-08 18:41 ` jv244 at cam dot ac dot uk
@ 2008-12-08 19:33 ` kargl at gcc dot gnu dot org
  2009-03-29  8:31 ` [Bug fortran/38444] Poor recovery from error fxcoudert at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: kargl at gcc dot gnu dot org @ 2008-12-08 19:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from kargl at gcc dot gnu dot org  2008-12-08 19:31 -------
(In reply to comment #2)
> (In reply to comment #1)
> > -         gfc_error (msg, sym->name, where, gfc_basic_typename (sym->ts.type));
> > +         gfc_fatal_error (msg, sym->name, where,
> > +                          gfc_basic_typename (sym->ts.type));
> 
> That produces too few error messages. I.e. 
> 
> IMPLICIT NONE
> INTEGER :: a,b,c,d,e,f,g,h,a
> a=0 ; b=0 ; c=0 ; d=0 ; e=0 ; f=0 ; g=0 ; h=0; i=0
> END
> 
> should produce (like NAG f95, ifort) two errors only.
> 

Unfortunately, the first error causes the entire line to
be rejected.  Thus, all your variables are implicitly typed
when gfortran tries to continue with processing the file.
AFAIK, gfortran cannot accept a partially correct specification
statement.

If you fix the fatal error, you'll then see the second error.
So, you can view my patch as an all-or-nothing solution.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38444


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/38444] Poor recovery from error
  2008-12-08 14:30 [Bug fortran/38444] New: poor error message jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2008-12-08 19:33 ` kargl at gcc dot gnu dot org
@ 2009-03-29  8:31 ` fxcoudert at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2009-03-29  8:31 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |error-recovery
   Last reconfirmed|0000-00-00 00:00:00         |2009-03-29 08:30:49
               date|                            |
            Summary|poor error message          |Poor recovery from error


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38444


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-29  8:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-08 14:30 [Bug fortran/38444] New: poor error message jv244 at cam dot ac dot uk
2008-12-08 18:25 ` [Bug fortran/38444] " kargl at gcc dot gnu dot org
2008-12-08 18:41 ` jv244 at cam dot ac dot uk
2008-12-08 19:33 ` kargl at gcc dot gnu dot org
2009-03-29  8:31 ` [Bug fortran/38444] Poor recovery from error fxcoudert at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).