This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix fortran/13257, Error instead of warning for missing comma in format string


I decided to get my hands dirty with fixing some gfortran bugs so I started with a very
simple bug. This is an extension which we used to accept with g77 and shows up in
SPEC too which is one of the reasons why I decided to look into it.


Take the following code:
      subroutine mysub
      dimension ibar(5)
      write (3,1001) ( ibar(m), m = 1, 5 )

 1001 format (/5x,' ',i4' '/ )
      return
      end

there should be a comma after "i4" to be this valid fortran.
This patch makes that comma option as an extension to fortran.

OK for 4.0 and the mainline?
Built and tested on powerpc-darwin with no regressions.

Thanks,
Andrew Pinski

fortran/ChangeLog:
	* io.c (check_format): Allow an optional comma
	between descriptions.

libgfortran/ChangeLog:
	* format.c (parse_format_list): Allow an optional comma
	between descriptions.

testsuite/ChangeLog:
	* comma_format_extension_1.f: New test.
	* comma_format_extension_2.f: New test.


Attachment: fixPR13257.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]