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

--- Comment #2 from janus at gcc dot gnu.org ---
Since it seems that execute_command_line always sets a return value for the
exitstat argument, one probably does not need to check against an initial value
at all:



Index: libgfortran/intrinsics/execute_command_line.c
===================================================================
--- libgfortran/intrinsics/execute_command_line.c       (revision 254678)
+++ libgfortran/intrinsics/execute_command_line.c       (working copy)
@@ -145,15 +145,12 @@ execute_command_line_i4 (const char *command, GFC_
                         gfc_charlen_type cmdmsg_len)
 {
   bool w = wait ? *wait : true;
-  int estat, estat_initial, cstat;
+  int estat, cstat;

-  if (exitstat)
-    estat_initial = estat = *exitstat;
-
   execute_command_line (command, w, &estat, cmdstat ? &cstat : NULL,
                        cmdmsg, command_len, cmdmsg_len);

-  if (exitstat && estat != estat_initial)
+  if (exitstat)
     *exitstat = estat;
   if (cmdstat)
     *cmdstat = cstat;

Reply via email to