Re: [commit: ghc] master: Fix the OFFSET macro (53e9916)

Gabriel Dos Reis <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <CAAiZkiDjbe31DrsNkLPTp6Hu3hBmt7XfwXDFfV+VJO2EAsHXjg@mail.gmail.com>
On Fri, Nov 16, 2012 at 11:15 AM, Ian Lynagh <[email protected]> wrote:
> Hi Gaby,
>
> On Thu, Nov 15, 2012 at 11:26:04AM -0600, Gabriel Dos Reis wrote:
>> On Tue, Nov 13, 2012 at 1:41 PM, Ian Lynagh <[email protected]> wrote:
>> >
>> >     When offsetof is defined, we use that. This avoids "variably
>> >     modified at file scope" warnings/errors with recent gccs.
>>
>> Is there at all any C compiler used to build GHC that does not
>> define offsetof?  It is a standard C macro defined in <stddef.h>
>> that even freestanding C compilers have to provide.
>
> I think you're probably right. I was being conservative, so as to be
> sure not to break anything, but I've made it unconditionally use
> offsetof now. I'm sure that we'll hear soon enough if that causes any
> problems.

Hi Ian,
Thanks for the cleanup.  It simplifies the code base.  The only thing
you need to ensure is that <stddef.h> is included.  Otherwise, if
anything breaks, it is probably because the previous definition
of OFFSET contained a bug :-)

Best,

-- Gaby
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.