-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
it is easy confuse CLI options / command line parameters -D
and -O
when switching between zig build
and zig build-exe
#12341
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
Comments
Usage:
Sorry for the confusion, Leaving the issue open to track this problem. |
undefined
assignment to pointers-D
and -O
for command line parameters
-D
and -O
for command line parameters-D
and -O
when switching between zig build
and zig build-exe
Ah that makes more sense. Thanks for the quick response |
The more general issue here is that the meaning of |
was helping someone earlier and came across this problem (yet again), i think a potential solution would be to only allow the C style |
Uh oh!
There was an error while loading. Please reload this page.
Zig Version
0.10.0-dev.3445
Steps to Reproduce
Access the Godbolt playground for the following code or compile on your local and observe using a disassembler:
Compile using
-DReleaseFast
.Expected Behavior
Assigning pointers to
undefined
should be optimized out in ReleaseFast. Assigning pointers toundefined
is extremely useful to catch use after free UB in development, especially in more complicateddeinit()
functions to make access to the self after destruction fail. However, it can be a pointless hit to performance when it is not optimized out in production.Actual Behavior
Compiled with
-DReleaseFast
the relevant assembly code is the following:Note how it still included the assembly for the
message.ptr.* = undefined
instruction.The text was updated successfully, but these errors were encountered: