Eric,

Paul Eggert wrote:
> unless this offsetof bug occurs in real code, it might
> be better to not worry about it.

I agree. It's the first time in my life that I see someone doing
'sizeof' of an 'offsetof' expression. It's not a realistic use of the
'offsetof' macro.

And the workaround is trivial: just add parentheses. It also makes the
code easier to read:
  sizeof (offsetof (struct d, e))
is less ambiguous than
  sizeof offsetof (struct d, e)

Bruno

Reply via email to