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
$ zig build-exe -fno-emit-bin main.zig
main.zig:2:21: error: expected type 'bool', found 'comptime_int'
const a: bool = 2;
^
referenced by:
posixCallMainAndExit: /home/lee/zig/0.14.0-dev.2989+bf6ee7cb3/files/lib/std/start.zig:656:37
_start: /home/lee/zig/0.14.0-dev.2989+bf6ee7cb3/files/lib/std/start.zig:464:40
3 reference(s) hidden; use '-freference-trace=5' to see all references
$ echo $?
1
Expected Behavior
The same error as without -fno-emit-bin:
$ zig build-exe empty.c main.zig
main.zig:2:21: error: expected type 'bool', found 'comptime_int'
const a: bool = 2;
^
referenced by:
posixCallMainAndExit: /home/lee/zig/0.14.0-dev.2989+bf6ee7cb3/files/lib/std/start.zig:656:37
_start: /home/lee/zig/0.14.0-dev.2989+bf6ee7cb3/files/lib/std/start.zig:464:40
3 reference(s) hidden; use '-freference-trace=5' to see all references
$ echo $?
1
The text was updated successfully, but these errors were encountered:
leecannon
added
the
bug
Observed behavior contradicts documented or intended behavior
label
Jan 30, 2025
leecannon
changed the title
-fno-emit-bin does not report compile errors when c files included in build
No compile errors with -fno-emit-bin if c files in the build
Feb 3, 2025
Zig Version
0.14.0-dev.2989+bf6ee7cb3
Steps to Reproduce and Observed Behavior
With an empty c file called
empty.c
andmain.zig
containing:The correct behavior occurs without the c file:
Expected Behavior
The same error as without
-fno-emit-bin
:The text was updated successfully, but these errors were encountered: