mirror of
https://github.com/ziglang/zig.git
synced 2025-12-31 10:33:19 +00:00
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;
This commit is contained in:
parent
fc001110b4
commit
dc7608da97
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user