From 883ffd3e6dcedfccb39969fd9791e70c901410ec Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Mon, 28 Mar 2016 11:51:41 +1100 Subject: * runtest.exp: Fixes identified by the Frink static analyser: (1) use -- in switch commands for safety, (2) remove unreachable return commands after error commands, (3) replace abbreviated "info proc" with "info procs", (4) use -- in unset commands for safety where the variable name is itself a variable. * lib/dg.exp: Likewise. * lib/debugger.exp: Likewise. * lib/framework.exp: Likewise. * lib/remote.exp: Likewise. * lib/target.exp: Likewise. * lib/targetdb.exp: Likewise. * lib/telnet.exp: Likewise. * lib/utils.exp: Likewise. --- lib/framework.exp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/framework.exp') diff --git a/lib/framework.exp b/lib/framework.exp index 5cf0201..8404b38 100644 --- a/lib/framework.exp +++ b/lib/framework.exp @@ -303,7 +303,7 @@ proc clone_output { message } { } regsub "^\[ \t\]*(\[^ \t\]+).*$" "$message" "\\1" firstword - switch -glob "$firstword" { + switch -glob -- "$firstword" { "PASS:" - "XFAIL:" - "KFAIL:" - @@ -628,7 +628,7 @@ proc clear_xfail { args } { set argc [ llength $args ] for { set i 0 } { $i < $argc } { incr i } { set sub_arg [ lindex $args $i ] - switch -glob $sub_arg { + switch -glob -- $sub_arg { "*-*-*" { # is a configuration triplet if {[istarget $sub_arg]} { set xfail_flag 0 @@ -649,7 +649,7 @@ proc clear_kfail { args } { set argc [ llength $args ] for { set i 0 } { $i < $argc } { incr i } { set sub_arg [ lindex $args $i ] - switch -glob $sub_arg { + switch -glob -- $sub_arg { "*-*-*" { # is a configuration triplet if {[istarget $sub_arg]} { set kfail_flag 0 @@ -717,7 +717,7 @@ proc record_test { type message args } { xml_output " " } - switch $type { + switch -- $type { PASS { if {$prms_id} { set message [concat $message "\t(PRMS $prms_id)"] -- cgit v1.1