4 ms·
Your compiler probably has a built-in method to achieve the equivalent of offsetof without invoking undefined behavior. GCC has __builtin_offsetof: https://gcc
by madmoose 11y ago
Your compiler probably has a built-in method to achieve the equivalent of offsetof without invoking undefined behavior.
GCC has __builtin_offsetof: https://gcc.gnu.org/onlinedocs/gcc/Offsetof.html https://gcc.gnu.org/onlinedocs/gcc/Offsetof.html
- masklinn 11y agooffsetof is part of C89 stddef.h, why would you call the underlying GCC-specific __builtin_offsetof? Just call offsetof that's what it's here for, __builtin_offsetof is the GCC implementation detail.