Bug 33672 - Additional runtime checks needed for namelist reads
Summary: Additional runtime checks needed for namelist reads
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Jerry DeLisle
URL:
Keywords: accepts-invalid, diagnostic
Depends on:
Blocks:
 
Reported: 2007-10-05 23:40 UTC by Jerry DeLisle
Modified: 2007-10-15 01:37 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-10-07 20:07:36


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerry DeLisle 2007-10-05 23:40:34 UTC
As discussed on comp.lang.fortran.  The test case namelist_15.f90 has three examples of invalid derived type specifiers.  Only one none-zero rank object is allowed.

>   write (10, '(A)') " x%i = , ,-3, -4"

The line above is illegal. It represents an array of arrays (i and m), which 
is not allowed in Fortran (see "Fortran 95/2003 Explained", Section 6.13).

> >   write (10, '(A)') " x(2)%m(2)%ch(1)(1) ='w',"

This line contains a spurious '(1)'

> >   write (10, '(A)') " x%m%ch(:)(2) = 'z','z','z','z','z','z','z','z',"

This is also an attempt at an array of arrays (x and m).

Thanks to Mike Metcalf for clarifications.  See the book.
Comment 1 patchapp@dberlin.org 2007-10-08 13:05:21 UTC
Subject: Bug number PR33672

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00424.html
Comment 2 Tobias Burnus 2007-10-14 21:05:02 UTC
For comp.lang.fortran, see:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/e29f484b7d822ed3/
Comment 3 Jerry DeLisle 2007-10-15 01:33:26 UTC
Subject: Bug 33672

Author: jvdelisle
Date: Mon Oct 15 01:33:16 2007
New Revision: 129309

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129309
Log:
2007-10-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33672
	* io/list_read.c (nml_parse_qualifier): Add character specific error
	messages.  Check for proper form of sub-string qualifiers.  Return the
	parsed_rank flag indicating a non-zero rank qualifier.
	(nml_get_obj_data):  Count the instances of non-zero rank qualifiers.
	Issue an error if more that one non-zero rank qualifier is found.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/list_read.c

Comment 4 Jerry DeLisle 2007-10-15 01:36:24 UTC
Subject: Bug 33672

Author: jvdelisle
Date: Mon Oct 15 01:36:13 2007
New Revision: 129310

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129310
Log:
2007-10-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33672
	* gfortran.dg/namelist_40.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/namelist_40.f90
Modified:
    trunk/gcc/testsuite/ChangeLog

Comment 5 Jerry DeLisle 2007-10-15 01:37:53 UTC
Closing