Closed guidovranken closed 3 years ago
This is due to this macro:
Which is inelegant, but the most portable way to get the field offset that I know of.
@NielsFerguson FYI, for MsQuic, we have the following abstraction (Linux implementation): https://github.com/microsoft/msquic/blob/4c1527906233a8047068800d8b273852bb41a504/src/inc/msquic_linux.h#L166
#define FIELD_OFFSET(type, field) offsetof(type, field)
We use offsetof in SymCrypt now too
If compiled with UndefinedBehaviorSanitizer (clang with
-fsanitize=undefined
, on Linux 64 bit), execution of this program will print: