Repository navigation
Conversation
No it's not guaranteed at all, it depends on compilers types and versions. We've had to add #ifndef/#define offsetof everywhere for a long time now due to this. However, here in cebtree we already define it, and use it almost everywhere, so the one you've found clearly is a leftover that was uncaught. I'll merge it, thanks Ben! |
I should have been clearer; I meant guaranteed by the standards. If you care about supporting non-standard C compilers, then nothing is ever guaranteed :)
Sure thing! |
|
Now merged, I've extended the commit message a little bit from the one you wrote for ebtree. I'm going to merge it into haproxy as well. Thanks Ben! |
This header unconditionally
includesstddef.h, sooffsetofis guaranteed to be defined.(Only submitting this PR to shut up UBSan in HAProxy.)