- changed status to resolved
Bit field for FFI c structure
Issue #169
resolved
It's time to implement bit field for c struct.
The bit field clause should look like this:
(define-c-struct foo
(bit-field unsigned-int (a 1) (b 2) (c 3) (d 4) (e 5))
)
So starting with keyword bit-field
then type (must be integer type) then field definitions.
We also need to consider big and little endian. These pages shows how bit fields are constructed on both architecture:
- http://mjfrazer.org/mjfrazer/bitfields/
- https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=7766044
In C, overflowing bit field wouldn't be an error (not sure if spec says so) but just creating 2 storages. However it's rather pain in the ass to do it. So it's better to raise &assertion
.
Comments (1)
-
reporter - Log in to comment
Supporing bit field (Fixes
#169)→ <<cset faef7a1da5fa>>