-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zig build with safety on get "Illegal instruction" when using c "container_of" #15962
Comments
The |
Thanks for the solutions. Actually I am working on an embedded project mixing zig and c, the "rt_container_of" is almost everywhere in the c source code. It's really hard to locate the cause of "Illegal instruction" considering it's a runtime error and just results in “hard-fault” on baremetal not even a panic which can print useful debug message. Hopefully the "Illegal instruction" can be a panic in the future. |
That improvement is tracked by #5163 |
Zig Version
0.10.1
Steps to Reproduce and Observed Behavior
m.c file
m.h
main.zig
build.zig
when run "zig build" and then run the generated .exe:

but if build without safety check, it's ok:
Expected Behavior
zig build with safety on should work well
The text was updated successfully, but these errors were encountered: