bug-gnulib
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]