This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32987] TAB in FORMAT: accept extension, warn with -std=f*
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Aug 2007 16:53:32 -0000
- Subject: [Bug fortran/32987] TAB in FORMAT: accept extension, warn with -std=f*
- References: <bug-32987-12095@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from burnus at gcc dot gnu dot org 2007-08-04 16:53 -------
I just checked: ifort, sunf95, openf95, g95 and even the picky NAG f95 accept
it. None of the compilers gives a warning except of "ifort" when passing the
option "-stand 95":
fortcom: Warning: format_with_tab.f, line 3: Extension to FORTRAN-90: tab
formatting
10 format ('Hello ', 'bug!')
------------------------^
I therefore suggest:
- Silently accept the tab in libgfortran
- Give a warning or an error with -std=f95/f2003.
Index: gcc/fortran/io.c
===================================================================
--- gcc/fortran/io.c (revision 127204)
+++ gcc/fortran/io.c (working copy)
@@ -183,0 +184,2 @@ next_char_not_space (void)
+ if (c == '\t' && !(gfc_option.allow_std & GFC_STD_GNU))
+ gfc_warning ("Extension: Tab character in format at %C");
Index: libgfortran/io/format.c
===================================================================
--- libgfortran/io/format.c (revision 127204)
+++ libgfortran/io/format.c (working copy)
@@ -95 +95 @@ next_char (format_data *fmt, int literal
- while (c == ' ' && !literal);
+ while ((c == ' ' || c == '\t') && !literal);
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
Status|RESOLVED |UNCONFIRMED
Keywords| |diagnostic
Resolution|FIXED |
Summary|GFortran FORMAT statement |TAB in FORMAT: accept
|error |extension, warn with -std=f*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32987