clean up some ??? code

Ben Elliston <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
Hi Rob

perror takes a second argument which can set the errcnt (added in
1995).  However, code written after that time doesn't make use of it.
Is there any reason why the following isn't fine?

Cheers,
Ben

diff --git a/lib/dg.exp b/lib/dg.exp
index 0114c76..a2503fb 100644
--- a/lib/dg.exp
+++ b/lib/dg.exp
@@ -686,9 +689,7 @@ proc dg-test { args } {
 	    } else {
 		perror "$name: $errmsg for \"$op\"\n"
 	    }
-	    # ??? The call to unresolved here is necessary to clear `errcnt'.
-	    # What we really need is a proc like perror that doesn't set errcnt.
-	    unresolved "$name: $errmsg for \"$op\""
+	    perror "$name: $errmsg for \"$op\"" 0
 	    return
 	}
     }
@@ -875,10 +876,7 @@ proc dg-test { args } {
 	verbose "Running dg-final tests." 3
 	verbose "dg-final-proc:\n[info body dg-final-proc]" 4
 	if {[catch "dg-final-proc $prog" errmsg]} {
-	    perror "$name: error executing dg-final: $errmsg"
-	    # ??? The call to unresolved here is necessary to clear `errcnt'.
-	    # What we really need is a proc like perror that doesn't set errcnt.
-	    unresolved "$name: error executing dg-final: $errmsg"
+	    perror "$name: error executing dg-final: $errmsg" 0
 	}
     }
 
diff --git a/runtest.exp b/runtest.exp
index d7facf8..478ae33 100644
--- a/runtest.exp
+++ b/runtest.exp
@@ -1499,13 +1499,7 @@ proc runtest { test_file_name } {
     } else {
 	# This should never happen, but maybe if the file got removed
 	# between the `find' above and here.
-	perror "$test_file_name does not exist."
-	# ??? This is a hack.  We want to send a message to stderr and
-	# to the summary file (just like perror does), but we don't
-	# want the next testcase to get a spurious "unresolved" because
-	# errcnt != 0.  Calling `clone_output' is also supposed to be a
-	# no-no (see the comments for clone_output).
-	set errcnt 0
+	perror "$test_file_name does not exist." 0
     }
 }

_______________________________________________
DejaGnu mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/dejagnu
signature.asc (application/pgp-signature, 811 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIVAwUBVu07V3Y2KIi1WYjUAQgtSxAAsFfrZ+4+iHzJ62aj2FA2wLynTaq6Ela1
iS1FgHogdFPbJDeH3S5OekvwIYFAuyU9lze7s29U8oCgMRLf6TwRJispCyY0rUYb
TnmZ8fJSUsRTpIpnQnnuxj0wCUy125Bp/3YWe10WJVekAE+uGkJt+x4sKe1s1Ar8
f3cNuzmQDtR4f48AYbFZT9tvLtogtQNCPl7QO42soZaqNmrCL5GQrjnqQQaA9BfQ
IFdh63xBfbEWlX6wFOaKU6AAuilXPN5169/rndTxnNgSFPrkWMx5A+8iw7BJlaxv
udGohGT3gba2tDbu/jdZrxKDhfxXVNCWvlrlmJQGB2avm0ChutSaFXhCAcHxgnnC
+K4/eZCiuiKzT/ze49fInXXXVr63fJZc0K7309qLwIXoclXYAWksmdyhI2ijDPIZ
Xi4Xi6hOYCj46KBdhxWsT4x+8CrCPAFV/ItJyof49446GKRhUErlPVq80OgogCQd
R/mb3XI7ArW2pGWW0fSdAZPwrKDs2AOmGp88Yarrw1sUJtgXvdQDTLIBx3vR0hno
ONad5cc8USc4cW9Z0vbV0Y/VpXv8+wL+dpGqpQolSDZOSbaVyCwRIsYyl+9cXCZG
wm/61Znd2ger98ikHs1NWiivlLnUJxc1b17cfVa0cwNv9JL1kt1eK/2d9Rflxeen
7cskeSG9Aa4=
=KIaE
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.