xfs
[Top] [All Lists]

Re: [PATCH v2 1/4] xfsprogs: Prefix LIST_... macros to XFS_LIST_...

To: Jan Tulak <jtulak@xxxxxxxxxx>
Subject: Re: [PATCH v2 1/4] xfsprogs: Prefix LIST_... macros to XFS_LIST_...
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 4 Aug 2015 08:16:30 +1000
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1142980605.1953560.1438594488229.JavaMail.zimbra@xxxxxxxxxx>
References: <1437397018-12864-1-git-send-email-jtulak@xxxxxxxxxx> <1437397018-12864-2-git-send-email-jtulak@xxxxxxxxxx> <20150802234250.GT16638@dastard> <1142980605.1953560.1438594488229.JavaMail.zimbra@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Aug 03, 2015 at 05:34:48AM -0400, Jan Tulak wrote:
> > From: "Dave Chinner" <david@xxxxxxxxxxxxx>
> > What macros, and how do we get them included in the build? I
> > shouldn't need to go and use google to work out why a change is
> > beign made....
> > 
> > This is supposed to match what is required for libxfs/ so we don't
> > have to modify the kernel code we bring across. Without knowing
> > exactly how we are including conflicting definitions from the OS X
> > include files, it's really hard to suggest other possible
> > solutions...
> > 
> 
> Ahh, sorry, I already wrote a reply to Chris, but it looks like 
> I pressed "save" instead "send" - I found it in drafts and not 
> in send emails. /shy

No worries, we all do silly things like that from time to time,
myself included.

> Sure, these:
> 
> ../include/xfs/list.h:32:9: warning: 'LIST_HEAD' macro redefined 
> [-Wmacro-redefined]
> #define LIST_HEAD(name) \
>         ^
> /usr/include/sys/queue.h:417:9: note: previous definition is here
> #define LIST_HEAD(name, type)                                           \
>         ^
> (and the same for LIST_HEAD_INIT)
> 
> sys/queue.h is not linked directly, but from many system libraries. 
> A quick grep on /usr/include/ shows 24 header files including the queue,
> sys/mount.h one of them. And I didn't found a way how to avoid it.

Ok, so 4.4BSD introduced these years ago. Now it rings a bell, but I
can't find the relevant thread I'm thinking of (google has become
almost useless as a mailing list search engine in recent times).

I suspect that we are going to need an

#undef LIST_HEAD

somewhere in include/libxfs.h, libxfs/libxfs_priv.h and/or
include/list.h just to ensure we don't use the system definitions
(with a large comment explaining it).

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>