You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All idxHeader have gcc/clang's __attribute((packed))__, however, only some have its counterpart #pragma pack in MSVC.
This is not an issue because all data fields are currently 32 bits, MSVC will likely align the struct to 4 bytes, but this is unspecific/undefined behaviour. No idea if this already leads to bugs, or it will lead to bugs in the future, (or there is a standardized rule that I don't know and this is not a problem at all 😅 ).
Previous discussion #1573 (comment)
All
idxHeader
have gcc/clang's__attribute((packed))__
, however, only some have its counterpart#pragma pack
in MSVC.This is not an issue because all data fields are currently 32 bits, MSVC will likely align the struct to 4 bytes, but this is unspecific/undefined behaviour. No idea if this already leads to bugs, or it will lead to bugs in the future, (or there is a standardized rule that I don't know and this is not a problem at all 😅 ).
https://github.com/search?q=repo%3Axiaoyifang%2Fgoldendict-ng%20idxHeader&type=code
Need more study to know if we can add
alignas(4)
for allidxHeader
to ensure correctness.The text was updated successfully, but these errors were encountered: