diff options
author | Ben Elliston <bje@gnu.org> | 2016-03-29 10:52:29 +1100 |
---|---|---|
committer | Ben Elliston <bje@gnu.org> | 2016-03-29 10:52:29 +1100 |
commit | 85e283265453b698f1f5a22b2eeedc0c05aafe91 (patch) | |
tree | 9e9a52b78d6078cc5cd9512699015d42f016d5d4 /baseboards | |
parent | 569f8718b534a2cd9511a7d640352eb0126ff492 (diff) |
More fixes identified by the Frink static analyser:
(1) use -- in switch commands for safety,
(2) add braces around exprs,
(3) replace abbreviated "info proc" with "info procs",
(4) use -- in regexp commands for safety where the expression is a
variable that could begin with '-'.
Diffstat (limited to 'baseboards')
-rw-r--r-- | baseboards/androideabi.exp | 10 | ||||
-rw-r--r-- | baseboards/basic-sid.exp | 2 | ||||
-rw-r--r-- | baseboards/multi-sim.exp | 18 |
3 files changed, 15 insertions, 15 deletions
diff --git a/baseboards/androideabi.exp b/baseboards/androideabi.exp index e84d150..aeadcde 100644 --- a/baseboards/androideabi.exp +++ b/baseboards/androideabi.exp @@ -55,14 +55,14 @@ proc adb_load { dest prog args } { set inp "" } - if ![file exists $prog] then { + if {![file exists $prog]} then { # We call both here because this should never happen. perror "$prog does not exist in standard_load." verbose -log "$prog does not exist." 3 return "untested" } - if [is_remote $dest] { + if {[is_remote $dest]} { set localfile "./[file tail $prog].[pid]" set remotefile "$android_tmp_dir/[file tail $prog].[pid]" set remotefile [remote_download $dest $prog $remotefile] @@ -79,8 +79,8 @@ proc adb_load { dest prog args } { return "unresolved" } } - if [board_info $dest exists remote_link] { - if [[board_info $dest remote_link] $remotefile] { + if {[board_info $dest exists remote_link]} { + if {[[board_info $dest remote_link] $remotefile]} { verbose -log "Couldn't do remote link" # Can't use remote_file delete since /system/bin/rm does not # support -f on Android. @@ -101,7 +101,7 @@ proc adb_load { dest prog args } { set status [lindex $status 0] verbose -log "Executed $prog, status $status" 2 - if ![string match "" $output] { + if {![string match "" $output]} { verbose -log -- "$output" 2 } if { $status == 0 } { diff --git a/baseboards/basic-sid.exp b/baseboards/basic-sid.exp index 72397c7..b40718a 100644 --- a/baseboards/basic-sid.exp +++ b/baseboards/basic-sid.exp @@ -67,7 +67,7 @@ proc find_rawsid { } { # srcdir=/..../sid/component/testsuite set tcl_library "$srcdir/tcl/library" global host_os - switch -glob $host_os { + switch -glob -- $host_os { {cygwin*} { set tcl_library [exec cygpath -w $tcl_library] } } set env(TCL_LIBRARY) $tcl_library diff --git a/baseboards/multi-sim.exp b/baseboards/multi-sim.exp index 65c21c0..a1d668d 100644 --- a/baseboards/multi-sim.exp +++ b/baseboards/multi-sim.exp @@ -78,24 +78,24 @@ proc rpath_flags { args } { # libraries, if testing a built but not installed compiler it will not # find libraries like libstdc++.so or libgfortran.so so we add the # extra hack/search so it can work. - if [string match "." $rpathdir] { - if [string match $i "libstdc++.so"] { - if [file exists "$gccpath/libstdc++-v3/src/.libs/libstdc++.so"] { + if {[string match "." $rpathdir]} { + if {[string match $i "libstdc++.so"]} { + if {[file exists "$gccpath/libstdc++-v3/src/.libs/libstdc++.so"]} { set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libstdc++-v3/src/.libs" } } - if [string match $i "libgfortran.so"] { - if [file exists "$gccpath/libgfortran/.libs/libgfortran.so"] { + if {[string match $i "libgfortran.so"]} { + if {[file exists "$gccpath/libgfortran/.libs/libgfortran.so"]} { set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libgfortran/.libs" } } - if [string match $i "libatomic.so"] { - if [file exists "$gccpath/libatomic/.libs/libatomic.so"] { + if {[string match $i "libatomic.so"]} { + if {[file exists "$gccpath/libatomic/.libs/libatomic.so"]} { set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libatomic/.libs" } } - if [string match $i "libgomp.so"] { - if [file exists "$gccpath/libgomp/.libs/libgomp.so"] { + if {[string match $i "libgomp.so"]} { + if {[file exists "$gccpath/libgomp/.libs/libgomp.so"]} { set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libgomp/.libs" } } |