-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Unclear meaning of bitsize of an array #23781
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
Arrays are not bit-packed. |
Should note that it's 2 extra bits of padding per item, except the last one. So |
Yes that I understand. Array items are not bitpacked, but still these last 2 bits are chopped off inside the bitSizeOf builtin function. |
Should |
cc @mlugg |
Intended |
I encountered an unclear language thing, which - as a simple user - was surprising me.
The sizeOf Letters7 returns obviously 7, but bitSizeOf returns 54.
Where are the 2 missing bits?
The meaning of the bitsize is unclear in my opinion and should maybe be clarified somewhere (if possible).
As far as I understand the bitsize is the size which it would occupy in a packed struct.
However: Letters7 is not allowed by the compiler to reside inside a packed struct.
The reason that I am posting this issue is, is the question:
Is this a little inconsistency in the language?
The text was updated successfully, but these errors were encountered: