-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
miscellaneous thoughts from PavelVozenilek #548
Comments
@sizeof doesn't seem to work at all:
gives error:
It is probably better to report 0.1.1 errors in one thread. Many previous issues have valuable discussions and flooding the tracker with every little problem would hide them. |
Automatic structure packing does not seem to work optimally:
Invoking it gives Edit: it also fails with no less-than-byte members:
Gives Btw, I think this feature (automatic rearangement of structure members) is mistake, wrong and confusing. In addition keyword I'd once suggested solution here: |
Struct method cannot take non-const pointer. (Could be my misunderstanding.)
fails with error:
When I add |
This compiles, in spite of struct method and struct member having the same name:
But when I try to use the method it fails:
with error:
Something feels wrong. |
printf also doesn't like
compiled but when I run the result executable it crashes. |
Zig requires initialization, even for empty structs:
results in :
While empty struct does not make much of sense, asking for its initialization is IMO error. |
Docs states:
However this compiles:
This feels like a bug, the offending function has to be called for error to show. |
Can you make a separate issue for this one? I have a clear answer for you, and I want to be able to direct other people to the issue. |
Same thing, can you make a separate issue? I have an answer and I want to be able to point back to the issue as a point of reference. |
Example copy pasted from the documentation works:
If I switch to variables it fails:
I get:
If I make only the
This feels inconsistent and buggy. |
Initialization of struct member does not allow to use previously initialized member. I tried:
and got error:
Removing the leading dot didn't help. |
Possibly another problem with This fails to compile:
with error:
|
prints
|
Another problem with This code:
does not invoke I think this is not what one expects. If some code contains active |
Third problem with Example:
With highlighting it is looks worse. Why not something as:
|
Inspired by "delete variable" thread I tried this:
To my surprise it compiles, and prints out some garbage value. Isn't this error, assignment of |
Following fails to compile:
with error:
|
Learning about
It mixes |
It seems that I can export C incompatible name using This compiles:
|
I downloaded latest build (
I get this:
As an aside: Hello World is supposed to be the most simple example, something very gentle to newcomers. |
Crash in generated executable, version 0.1.1:
compiles OK. When result executable is invoked it prints
and then crashes with standard Windows error dialog. |
Similarly it crashes when I invoke
compiles and results in
and the crash dialog. |
When I combine both compile time and run time
gives unexpected compiler error:
I feel something is wrong here. |
So called "child type" of pointers does not work, neither in 0.1.1 nor in the head. This line in docs:
I am also scratching my head what this feature means and where it could be used. |
This fails:
with strange error:
The text was updated successfully, but these errors were encountered: