diff options
| author | Asherah Connor <ashe@kivikakk.ee> | 2020-08-27 11:17:03 +1000 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2020-08-27 15:03:56 +0300 |
| commit | dc7608da973291aafb7a58f33eb65dc3389c123d (patch) | |
| tree | ed48626044e19fc8b78e17bf37441d71eda78508 /lib/std/start.zig | |
| parent | fc001110b4f4c271217ae6ce973c80a33925ca3b (diff) | |
| download | zig-dc7608da973291aafb7a58f33eb65dc3389c123d.tar.gz zig-dc7608da973291aafb7a58f33eb65dc3389c123d.zip | |
ensure main return type is not i8
Avoids a compile error from start.zig:
/home/kivikakk/zig/build/lib/zig/std/start.zig:265:28: error:
expected type 'u8', found 'i8'
return result;
^
/home/kivikakk/zig/build/lib/zig/std/start.zig:265:28: note:
unsigned 8-bit int cannot represent all possible signed 8-bit
values
return result;
Diffstat (limited to 'lib/std/start.zig')
| -rw-r--r-- | lib/std/start.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/start.zig b/lib/std/start.zig index 2b1bae060e..8e443a7c77 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -248,7 +248,7 @@ pub fn callMain() u8 { return 0; }, .Int => |info| { - if (info.bits != 8) { + if (info.bits != 8 or info.is_signed) { @compileError(bad_main_ret); } return root.main(); @@ -264,7 +264,7 @@ pub fn callMain() u8 { switch (@typeInfo(@TypeOf(result))) { .Void => return 0, .Int => |info| { - if (info.bits != 8) { + if (info.bits != 8 or info.is_signed) { @compileError(bad_main_ret); } return result; |
