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
I was just bitten by the fact that when translating structs, bitfields are not interpreted properly.
(I am using the libgen wrapper but I don't think it matters in this case).
And as such, assignment like fi.writepage = 0 may have a lot of side effect, ranging from incorrect value to stack smashing, due to the misalignment of the resulting structure compared to original definition.
I saw that there was a closed discussion on the matter on crystal side #3898.
Currently I am not sure how to address that on my code.
I don't know if it is possible,
but it would be nice at least, if crystal_lib would be able to issue warning or error message when bitfields are encoutered, so that the discovery is not delayed too much...
Or ideally, even if there is no bitfield support in crystal, that a placeholder is put into the structure, so that resulting translation is compatible in term of memory layout.
The text was updated successfully, but these errors were encountered:
Hello,
I was just bitten by the fact that when translating structs, bitfields are not interpreted properly.
(I am using the libgen wrapper but I don't think it matters in this case).
For eg fuse_file_info
is translated to
And as such, assignment like
fi.writepage = 0
may have a lot of side effect, ranging from incorrect value to stack smashing, due to the misalignment of the resulting structure compared to original definition.I saw that there was a closed discussion on the matter on crystal side #3898.
Currently I am not sure how to address that on my code.
I don't know if it is possible,
but it would be nice at least, if crystal_lib would be able to issue warning or error message when bitfields are encoutered, so that the discovery is not delayed too much...
Or ideally, even if there is no bitfield support in crystal, that a placeholder is put into the structure, so that resulting translation is compatible in term of memory layout.
The text was updated successfully, but these errors were encountered: