This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [PATCH] Fix fortran/PR20846 "inquire(FILE=..., UNIT=...) not flagged as error"


On Sat, May 28, 2005 at 11:43:51AM -0700, Steve Kargl wrote:
> On Tue, May 24, 2005 at 09:02:11PM +0300, Janne Blomqvist wrote:
> > 
> > attached patch fixes PR 20846 "inquire(FILE=..., UNIT=...) not flagged
> > as error".
> > 
> > ChangeLog:
> > 
> > 
> >         PR fortran/20846
> > 
> >         * trans-io.c (gfc_trans_inquire): Add sanity check for UNIT and
> >         FILE.
> > 
> > Patch itself is attached.
> > 
> 
> Janne's patch modified trans-io.c and I could not get
> the error message to print a sane locus incorrect line.
> I also recall that Paul (or Tobi) wanted to avoid error
> messages coming from the trans-* files if possible.  So,
> I've moved Janne's patch into io.c.  See attached patch
> and testcase.  Bootstrapped and regression tested on
> mainline.  Ok for mainline?  Ok for 4.0 after regtesting.
> 

Here's a better solution.

Janne, you've opened a can of worms with your patch to
PR 20846.

In looking at how the matching of INQUIRE is implemented,
I've found that neither constraint in 9.6.1 is flagged.
To implement the constraints and to point at the inquire
statement, I needed to add "locus where" to the gfc_inquire
struct; otherwise, the error message pointed to the end
of the statement.


2005-05-28  Steven G. Kargl  <kargls@comcast.com>

        * gfortran.h (gfc_inquire): Add locus to struct.
        * io.c (gfc_match_inquire): Implement constraints in 9.6.1

2005-05-28  Steven G. Kargl  <kargls@comcast.com>

        gfortran.dg/inquire_8.f90: new test.

-- 
Steve

Attachment: io.c.diff
Description: Text document

Attachment: inquire_8.f90
Description: Text document


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