public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34424]  New: Internal file forbidden as I/O list item
@ 2007-12-10 18:28 fxcoudert at gcc dot gnu dot org
  2007-12-10 18:29 ` [Bug fortran/34424] " fxcoudert at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-12-10 18:28 UTC (permalink / raw)
  To: gcc-bugs

The following code is invalid (from comp.lang.fortran):

  character(len=16) :: strtofind !String one is looking for
  strtofind = "1               "
  write(strtofind,'(A1,A,A1)') ',',trim(adjustl(strtofind)),','
  print *, "|", strtofind , "|"
  end

9.4.4.4 Data Transfer (in F95) says "If an internal file has been specified, an
input/output list item shall not be in the file or associated with the file."

This is basically equivalent to:
  character(len=10) :: s
  write(s,'(A)') s
  end


-- 
           Summary: Internal file forbidden as I/O list item
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


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


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

* [Bug fortran/34424] Internal file forbidden as I/O list item
  2007-12-10 18:28 [Bug fortran/34424] New: Internal file forbidden as I/O list item fxcoudert at gcc dot gnu dot org
@ 2007-12-10 18:29 ` fxcoudert at gcc dot gnu dot org
  2007-12-10 18:45 ` burnus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-12-10 18:29 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-12-10 18:28:51
               date|                            |
            Version|unknown                     |4.3.0


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


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

* [Bug fortran/34424] Internal file forbidden as I/O list item
  2007-12-10 18:28 [Bug fortran/34424] New: Internal file forbidden as I/O list item fxcoudert at gcc dot gnu dot org
  2007-12-10 18:29 ` [Bug fortran/34424] " fxcoudert at gcc dot gnu dot org
@ 2007-12-10 18:45 ` burnus at gcc dot gnu dot org
  2007-12-11  8:55 ` burnus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-10 18:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2007-12-10 18:45 -------
> The following code is invalid (from comp.lang.fortran):
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/91a37e74fa305e31/

Agreed.

> This is basically equivalent to:

Here, no compiler detects this for the two programs, not even NAG f95 with all
run-time checks turned on; thus it might end up as won't-fix PR. But maybe
someone has a smart idea how this can be implemented.


-- 


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


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

* [Bug fortran/34424] Internal file forbidden as I/O list item
  2007-12-10 18:28 [Bug fortran/34424] New: Internal file forbidden as I/O list item fxcoudert at gcc dot gnu dot org
  2007-12-10 18:29 ` [Bug fortran/34424] " fxcoudert at gcc dot gnu dot org
  2007-12-10 18:45 ` burnus at gcc dot gnu dot org
@ 2007-12-11  8:55 ` burnus at gcc dot gnu dot org
  2007-12-14 19:27 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-11  8:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2007-12-11 08:54 -------
Maybe it is valid. Richard Maine writes in the thread:
---------- quote --------------------
It isn't allowed. But that restriction is in a different place (a much
more sensible one). [...]

For that one see 9.11 in f2003 (The section titled "Restrictions on
input/output statements", which was at least an attempt to collect these
things). Sixth para

  "The value of a specifier in an input/output statement shall not
depend on any input-item..."

But this is specific to input items. The original case was output. And
as Dick noted, the darned phrasing might indeed have a hole in that
strtosearch wasn't exactly an output item. 
----------end of quote--------------------


-- 


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


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

* [Bug fortran/34424] Internal file forbidden as I/O list item
  2007-12-10 18:28 [Bug fortran/34424] New: Internal file forbidden as I/O list item fxcoudert at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-12-11  8:55 ` burnus at gcc dot gnu dot org
@ 2007-12-14 19:27 ` jvdelisle at gcc dot gnu dot org
  2007-12-14 20:00 ` burnus at gcc dot gnu dot org
  2008-03-15  7:47 ` jvdelisle at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-14 19:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2007-12-14 19:27 -------
I will give it a go.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-12-10 18:28:51         |2007-12-14 19:27:13
               date|                            |


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


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

* [Bug fortran/34424] Internal file forbidden as I/O list item
  2007-12-10 18:28 [Bug fortran/34424] New: Internal file forbidden as I/O list item fxcoudert at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-12-14 19:27 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-14 20:00 ` burnus at gcc dot gnu dot org
  2008-03-15  7:47 ` jvdelisle at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-12-14 20:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2007-12-14 20:00 -------
(In reply to comment #3)
> I will give it a go.

Dick Hendrickson wrote in c.l.fortran:
| I just sent the question to J3 as either an add-on to an existing
| similar interpretation request or as a new one.  As Dan said, it
| takes a while ;(.  It's always hard to predict the future, but I'd
| guess the answer will be "That's illegal."  That sure looks like
| the intent of the quoted text above.

Thus rejecting is probably ok, but I think this is an low-priority bug.


-- 


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


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

* [Bug fortran/34424] Internal file forbidden as I/O list item
  2007-12-10 18:28 [Bug fortran/34424] New: Internal file forbidden as I/O list item fxcoudert at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-12-14 20:00 ` burnus at gcc dot gnu dot org
@ 2008-03-15  7:47 ` jvdelisle at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-03-15  7:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2008-03-15 07:47 -------
The diagnostic could be handled by temporarily setting an attribute on the
internal file and then checking each list item to see if the attribute has been
set.  However, if the internal unit is an array section, one would have to do
dependency analysis.  That alone makes this not worth pursuing further.

Closing as won't fix.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |WONTFIX


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


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

end of thread, other threads:[~2008-03-15  7:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-10 18:28 [Bug fortran/34424] New: Internal file forbidden as I/O list item fxcoudert at gcc dot gnu dot org
2007-12-10 18:29 ` [Bug fortran/34424] " fxcoudert at gcc dot gnu dot org
2007-12-10 18:45 ` burnus at gcc dot gnu dot org
2007-12-11  8:55 ` burnus at gcc dot gnu dot org
2007-12-14 19:27 ` jvdelisle at gcc dot gnu dot org
2007-12-14 20:00 ` burnus at gcc dot gnu dot org
2008-03-15  7:47 ` jvdelisle 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).