public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/62296] New: EXECUTE_COMMAND_LINE not F2008 conforming
@ 2014-08-28 19:19 anlauf at gmx dot de
  2014-08-31 21:08 ` [Bug libfortran/62296] " anlauf at gmx dot de
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: anlauf at gmx dot de @ 2014-08-28 19:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62296

            Bug ID: 62296
           Summary: EXECUTE_COMMAND_LINE not F2008 conforming
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anlauf at gmx dot de

It appears that EXECUTE_COMMAND_LINE does not fully conform to F2008
in case the execute command fails.

F2008, 13.7.57 states:

CMDSTAT (optional) shall be a default integer scalar. It is an INTENT (OUT)
argument. It is assigned the value −1 if the processor does not support
command line execution, a processor-dependent positive value if an error
condition occurs, or the value −2 if no error condition occurs but WAIT
is present with the value false and the processor does not support
asynchronous execution. Otherwise it is assigned the value 0.
[...]
If a condition occurs that would assign a nonzero value to CMDSTAT but the
CMDSTAT variable is not present, error termination is initiated.


However, the following example behaves as follows:

program gfcbug126
  integer :: stat, cstat
  call execute_command_line ("/bin/true",  exitstat=stat, cmdstat=cstat)
  print *, stat, cstat
  call execute_command_line ("/bin/false", exitstat=stat, cmdstat=cstat)
  print *, stat, cstat
  call execute_command_line ("/bin/true",  exitstat=stat)
  print *, stat
  call execute_command_line ("/bin/false", exitstat=stat)
  print *, stat
end

Output:
           0           0
           1           0
           0
           1

I think the correct output should be like:
           0           0
           1           (some positive number, e.g. 1)
           0
 (error termination)

e.g. xlf 14.1 produces:
 0 0
 1 1
 0
"gfcbug126.f90", line 9: 1525-610 Error encountered while attempting to execute
the command:
/bin/false

Also, the (online) documentation should be adjusted to match the standard.
>From gcc-bugs-return-459427-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Aug 28 21:36:24 2014
Return-Path: <gcc-bugs-return-459427-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 28792 invoked by alias); 28 Aug 2014 21:36:23 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 28752 invoked by uid 48); 28 Aug 2014 21:36:16 -0000
From: "steven at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/43849] Add _gfortran_finalize function to close down the library
Date: Thu, 28 Aug 2014 21:36:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: steven at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cc
Message-ID: <bug-43849-4-Ib2fVS7zNj@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-43849-4@http.gcc.gnu.org/bugzilla/>
References: <bug-43849-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-08/txt/msg01924.txt.bz2
Content-length: 699

https://gcc.gnu.org/bugzilla/show_bug.cgi?idC849

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
                 CC|                            |steven at gcc dot gnu.org

--- Comment #5 from Steven Bosscher <steven at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #4)
> Is this PR still pertinent (2013-12-21)?

Yes, it could be necessary to force the shutdown from other libraries
that may want to output something and will need the buffers to be
flushed for that (e.g. libcaf).


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

end of thread, other threads:[~2015-08-23 21:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-28 19:19 [Bug libfortran/62296] New: EXECUTE_COMMAND_LINE not F2008 conforming anlauf at gmx dot de
2014-08-31 21:08 ` [Bug libfortran/62296] " anlauf at gmx dot de
2014-09-02 12:03 ` dominiq at lps dot ens.fr
2014-09-02 20:03 ` anlauf at gmx dot de
2014-12-04 21:10 ` anlauf at gmx dot de
2014-12-06 14:52 ` dominiq at lps dot ens.fr
2015-08-14  7:56 ` fxcoudert at gcc dot gnu.org
2015-08-23 21:25 ` fxcoudert at gcc dot gnu.org
2015-08-23 21:28 ` fxcoudert at gcc dot gnu.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).