You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importstd::io;
fnStringfoo() {
return"hello from foo!";
}
// c3c complains about using assert(false), so we need to trick itfnboolbar() {
return false;
}
fnvoidmain() {
io::printn("Hello, World!");
assert(bar(), "%s", foo());
}
The linker error message is undefined reference to .foo', we can further confirm this is the case by looking at the object file, where we find foo` referenced but undefined:
000000000 V $ct.char
0000000000000000 V $ct.sa$char
0000000000000000 V $ct.String
0000000000000003 r .file
000000000000000b r .func
0000000000000000 r .L.str
0000000000000000 T <module>_fn.bar
U <module>_fn.foo
0000000000000010 T <module>_fn.main
00000000000001a0 T main
0000000000000000 r .panic_msg
U std.core.builtin.panicf
U std.io.File.flush
U std.io.File.write
U std.io.File.write_byte
U std.io.stdout
Tested with c3c 0.6.2, with llvm 17.0.6 targeting x86_64-pc-linux-gnu (TODO: test with a master build)
Not sure if its the correct pass, but in sema_liveness.c I have found one example of a semantic pass not descending into the message arguments, and "liveness" sounds like it looks for dead code, which feels right.
The text was updated successfully, but these errors were encountered:
Minimal example:
The linker error message is
undefined reference to
.foo', we can further confirm this is the case by looking at the object file, where we find
foo` referenced but undefined:Tested with c3c 0.6.2, with llvm 17.0.6 targeting
x86_64-pc-linux-gnu
(TODO: test with a master build)Not sure if its the correct pass, but in
sema_liveness.c
I have found one example of a semantic pass not descending into the message arguments, and "liveness" sounds like it looks for dead code, which feels right.The text was updated successfully, but these errors were encountered: