[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] test-stddef: test offsetof compliance
From: |
Bruno Haible |
Subject: |
Re: [PATCH] test-stddef: test offsetof compliance |
Date: |
Tue, 17 Aug 2010 01:25:03 +0200 |
User-agent: |
KMail/1.9.9 |
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
[PATCHv2] stddef: fix offsetof compliance, Eric Blake, 2010/08/16