-
Notifications
You must be signed in to change notification settings - Fork 6
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
Nice to have: initialization of static arrays of builtin types #8
Comments
Only in function scope apparently: void main()
{
int[10] x = [0]; // error
}
int[10] x = [0]; // no error? Kinda surprised. But indeed, initializer translation needs work. In C, |
Huh, that's odd. But I was actually thinking -- would it be possible to write an Normally when translating, I have just been removing the initializer and using auto initialization. The one place where it is a problem is floating point types or char buffers. |
Fixed by recognizing {} and {0} on static arrays in 0f31729
I'm thinking that |
C:
D:
Results in a compiler error for size mismatch. Nicer would be:
This won't work in all situations, but the current behavior will never work.
The text was updated successfully, but these errors were encountered: