summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-06 18:13:50 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-06 18:13:50 -0700
commit9bbe6908eeb15650a5f065c8aea8142d1ce905ff (patch)
tree377ad14e171a0dca10ee2325d93eb225664f896c /libstd
parente68983d3805bbf857361b69b96407c2ff75b7b27 (diff)
downloadmc-9bbe6908eeb15650a5f065c8aea8142d1ce905ff.tar.gz
Compile error on reaching end of func without return.
Diffstat (limited to 'libstd')
-rw-r--r--libstd/getcwd.myr2
-rw-r--r--libstd/htab.myr1
-rw-r--r--libstd/spork.myr5
-rw-r--r--libstd/sys+linux-x64.myr2
-rw-r--r--libstd/wait+posixy.myr1
5 files changed, 8 insertions, 3 deletions
diff --git a/libstd/getcwd.myr b/libstd/getcwd.myr
index 4c53bb2..c9dbbea 100644
--- a/libstd/getcwd.myr
+++ b/libstd/getcwd.myr
@@ -25,5 +25,7 @@ const getcwd = {
len *= 2
;;
;;
+ /* unreachable; shut up return without value analysis */
+ -> ""
}
diff --git a/libstd/htab.myr b/libstd/htab.myr
index 5c311b1..c8cb694 100644
--- a/libstd/htab.myr
+++ b/libstd/htab.myr
@@ -90,6 +90,7 @@ generic idx = {ht, k
-> `Some i
;;
;;
+ -> `None /* fixme; while true should flag this as unreachable */
}
generic mkht = {h, eq
diff --git a/libstd/spork.myr b/libstd/spork.myr
index 8baa82d..1778037 100644
--- a/libstd/spork.myr
+++ b/libstd/spork.myr
@@ -52,9 +52,8 @@ const sporkfd = {cmd, infd, outfd
;;
close(infd)
close(outfd)
- if execvp(cmd[0], cmd) < 0
- fatal(1, "failed to exec %s\n")
- ;;
+ execvp(cmd[0], cmd) < 0
+ fatal(1, "failed to exec %s\n")
/* parent */
else
-> `Ok pid
diff --git a/libstd/sys+linux-x64.myr b/libstd/sys+linux-x64.myr
index 2642b65..4a3e3ea 100644
--- a/libstd/sys+linux-x64.myr
+++ b/libstd/sys+linux-x64.myr
@@ -43,6 +43,7 @@ pkg sys =
`Waitexit int32
`Waitsig int32
`Waitstop int32
+ `Waitfail int32
;;
type timespec = struct
@@ -796,4 +797,5 @@ const waitstatus = {st
elif (((st & 0xffff)*0x10001)>>8) > 0x7f00
-> `Waitstop ((st & 0xff00) >> 8)
;;
+ -> `Waitfail st /* wait failed to give a result */
}
diff --git a/libstd/wait+posixy.myr b/libstd/wait+posixy.myr
index 55efd9e..a690feb 100644
--- a/libstd/wait+posixy.myr
+++ b/libstd/wait+posixy.myr
@@ -26,6 +26,7 @@ const wait = {pid
a process exits. Loop instead.
*/
| `sys.Waitstop sig: goto again
+ | `sys.Waitfail fail: -> `Waiterror
| `sys.Waitsig sig: -> `Wsignalled
| `sys.Waitexit status:
if status == 0