This program should not even compile, but i tried it for fun because gcc/clang show 0 warnings with -Wall to see how c2v behaved with this code and resulted in some interesting bugs in the transpiler:
int
main ()
{
char r = -1;
unsigned s = r;
unsigned t = (unsigned char)r;
if (s != -1)
return 2;
if (t != 255)
return 1;
return 0;
}
is translated to:
[translated]
module main
fn main() {
r := -1
s := r
t := u8(r)
if s != -1 {
return
}
if t != 255 {
return
}
return
}
This program should not even compile, but i tried it for fun because gcc/clang show 0 warnings with -Wall to see how c2v behaved with this code and resulted in some interesting bugs in the transpiler:
is translated to:
Note: