public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "anlauf at gmx dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/62296] New: EXECUTE_COMMAND_LINE not F2008 conforming
Date: Thu, 28 Aug 2014 19:19:00 -0000	[thread overview]
Message-ID: <bug-62296-4@http.gcc.gnu.org/bugzilla/> (raw)

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).


             reply	other threads:[~2014-08-28 19:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 19:19 anlauf at gmx dot de [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-62296-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).