From: ebiederm@xmission.com (Eric W. Biederman)
To: "Américo Wang" <xiyou.wangcong@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
ebiederm@aristanetworks.com, randy.dunlap@oracle.com,
gregkh@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kobject: Suppress compiler warning with gcc 3.x
Date: Wed, 02 Jun 2010 23:40:12 -0700 [thread overview]
Message-ID: <m1k4qgr54j.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20100603062314.GB5580@cr0.nay.redhat.com> ("Américo Wang"'s message of "Thu\, 3 Jun 2010 14\:23\:14 +0800")
Américo Wang <xiyou.wangcong@gmail.com> writes:
> On Wed, Jun 02, 2010 at 11:02:28PM -0700, Eric W. Biederman wrote:
>>Américo Wang <xiyou.wangcong@gmail.com> writes:
>>
>>> On Thu, Jun 03, 2010 at 07:31:41AM +0200, Eric Dumazet wrote:
>>>>Le jeudi 03 juin 2010 à 14:23 +0900, Tetsuo Handa a écrit :
>>>>> Gcc 3.x generates a warning
>>>>>
>>>>> include/linux/sysfs.h:183: warning: parameter has incomplete type
>>>>>
>>>>> on each file.
>>>>> Suppress the warning by moving the definition of "enum kobj_ns_type"
>>>>> to before "#include <linux/sysfs.h>".
>>>>>
>>>>> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
>>>>
>>>>
>>>>I was about to submit same patch, but I was also reverting 27eabc7cb4b3
>>>>(sysfs: Don't use enums in inline function declaration.)
>>>>
>>>>So that sysfs_exit_ns() prototype is consistent regardless of
>>>>CONFIG_SYSFS
>>>>
>>>>What do you think ?
>>>>
>>>
>>> This looks odd, in sysfs.h we do have a forward declaration of
>>> enum kobj_ns_type... I am wondering why gcc 3.x doesn't recognize it.
>>
>>Because the replacement is an inline, and we are passing the enum by value
>>gcc wants to see the full definition, at the point where the inline function
>>is declared.
>>
>
> But sysfs_exit_ns() is not inlined if CONFIG_SYSFS here.
You are right gcc 3.x seems full of it. I was thinking of the !CONFIG_SYSFS
case where I had to pull out the enum because it is in fact inlined.
If we are going to worry about gcc 3.x and about my !CONFIG_SYSFS
inline function the clean way to handle this seems to be to introduce
a new header file that both sysfs.h and kobject.h can include.
Assuming/requiring that files that include sysfs.h also include
kobject.h to seems like the wrong way to go.
Eric
next prev parent reply other threads:[~2010-06-03 6:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-03 5:23 [PATCH] kobject: Suppress compiler warning with gcc 3.x Tetsuo Handa
2010-06-03 5:31 ` Eric Dumazet
2010-06-03 5:55 ` Américo Wang
2010-06-03 6:02 ` Eric W. Biederman
2010-06-03 6:23 ` Américo Wang
2010-06-03 6:40 ` Eric W. Biederman [this message]
2010-06-03 8:57 ` Américo Wang
2010-06-03 9:32 ` Eric Dumazet
2010-06-03 6:46 ` Eric Dumazet
2010-06-03 8:52 ` Américo Wang
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=m1k4qgr54j.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=ebiederm@aristanetworks.com \
--cc=eric.dumazet@gmail.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=randy.dunlap@oracle.com \
--cc=xiyou.wangcong@gmail.com \
/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