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

[Bug libfortran/82233] [6/7/8 Regression] execute_command_line causes program to stop when command fails (or does not exist)


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

--- Comment #3 from urbanjost at comcast dot net ---
Created attachment 42193
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42193&action=edit
specifically even if cmdstat option present, must have cmdmsg or get failure,
and man(1) page needs changed

After looking over the F2008 standard and the recent gfortran changes indicated
in the previous comment it looks like part of the changes between 5.0.4 and 6+
actually made EXECUTE_COMMAND_LINE(3f) more standard-conforming; so (although I
prefer the 5.0.4 version's behavior) I'd like to change the problem description
to two parts:

The man page for gfortran should mention that if CMDSTAT is not present and the
command cannot be executed that the program should terminate. It currently does
not:
  https://gcc.gnu.org/onlinedocs/gfortran/EXECUTE_005fCOMMAND_005fLINE.html
and that is a significant change from 5.0.4 (and is apparently what it should
do to be f2008 standard conforming).

Then, as the second attachment shows, supplying CMDSTAT should be sufficient,
but even when CMDSTAT is present if CMDMSG is not the program fails.

And I think a simple termination equivalent to "STOP 'message'" is probably the
expected behavior, where I am getting what looks to be an abort with
traceback/segfault.

Terminating the program is so unlike the de-factor standard SYSTEM(3f) or the C
routine system(3c) the 5.0.4- version behavior was far more intuitive, but the
f2008 standard does say command execution failure without the CMDSTAT option
being present terminates the program; although it is very arguable as to
exactly what that means on different systems (requiring unavailable resources,
file permissions, not being present, getting a "system error" when executing,
...???)

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