From: Dave Jones <davej@redhat.com>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: Trinity list <trinity@vger.kernel.org>
Subject: Re: [PATCH] net: include compat.h first incase some specifier-qualifier-list error
Date: Tue, 13 Aug 2013 11:48:33 -0400 [thread overview]
Message-ID: <20130813154833.GA12920@redhat.com> (raw)
In-Reply-To: <1376406809-12604-1-git-send-email-liuhangbin@gmail.com>
On Tue, Aug 13, 2013 at 11:13:29PM +0800, Hangbin Liu wrote:
> On some old distros, we use sa_family_t in linux/irda.h and linux/netlink.h
> first, but include the header file bits/sockaddr.h later in compat.h. Then it
> will compile failed with error: expected specifier-qualifier-list before
> ‘sa_family_t’. So let's move compat.h before irda.h and netlink.h
>
>
> diff --git a/net/irda_setsockopt.c b/net/irda_setsockopt.c
> index a5d96ec..21ff649 100644
> --- a/net/irda_setsockopt.c
> +++ b/net/irda_setsockopt.c
> @@ -1,9 +1,9 @@
> #include <stdlib.h>
> -#include <linux/irda.h>
> #include "net.h"
> #include "maps.h" // page_rand
> #include "compat.h"
> #include "trinity.h" // ARRAY_SIZE
> +#include <linux/irda.h>
>
> #define NR_SOL_IRDA_OPTS ARRAY_SIZE(irda_opts)
> static const unsigned int irda_opts[] = {
> diff --git a/net/netlink_setsockopt.c b/net/netlink_setsockopt.c
> index c6e9297..c401047 100644
> --- a/net/netlink_setsockopt.c
> +++ b/net/netlink_setsockopt.c
> @@ -1,9 +1,9 @@
> #include <stdlib.h>
> -#include <linux/netlink.h>
> #include "net.h"
> #include "maps.h" // page_rand
> #include "compat.h"
> #include "trinity.h" // ARRAY_SIZE
> +#include <linux/netlink.h>
This seems fragile to me. The idea here is that compat.h is to override
all the system includes, so reordering like this may mean that we won't
get the desired affect on some other distro.
I don't have a better answer for this though, need to think about it some more.
Perhaps changing compat.h to include something other than the bits/sockaddr
(Or adding additional includes there)..
What distribution was this ?
Dave
next prev parent reply other threads:[~2013-08-13 15:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-13 15:13 [PATCH] net: include compat.h first incase some specifier-qualifier-list error Hangbin Liu
2013-08-13 15:48 ` Dave Jones [this message]
2013-08-14 0:27 ` Hangbin Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130813154833.GA12920@redhat.com \
--to=davej@redhat.com \
--cc=liuhangbin@gmail.com \
--cc=trinity@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox