-
Notifications
You must be signed in to change notification settings - Fork 105
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
Show sizeof and offset of struct members when using language server #867
Comments
This isn't reliable as part of the language server, since the language server is always clangd, and thus won't be able to exactly replicate e.g. MSVC. Unless we can solve that problem, this isn't feasible. |
maybe there's a way to tell the language server the sizes of primitives |
@nanaian clang has an MSVC-compatible frontend (in the form of |
This would be a great improvement that would reduce guesswork of making sure structs are correctly sized and padded and quickly figuring out what sizeof may be used in code for example when allocating a struct.
There are catches tho, compiler specific packing/padding and default packing/padding as well as compiler packing/padding arguments.
For example MSVC usually packs to 4 bytes, but if the struct contains a double it packs to 8.
I suppose these nuances could be specified in compiler config and language server would need to be aware of what compiler args for packing are being used?
The text was updated successfully, but these errors were encountered: