From: "H. Peter Anvin" <hpa@zytor.com>
To: Kyle Moffett <mrmacman_g4@mac.com>
Cc: Christoph Hellwig <hch@infradead.org>,
David Miller <davem@davemloft.net>,
a.gruenbacher@computer.org, bunk@stusta.de,
linux-kernel@vger.kernel.org, jmorris@redhat.com,
dwmw2@infradead.org
Subject: Re: include/linux/xattr.h: how much userpace visible?
Date: Mon, 26 Feb 2007 18:09:44 -0800 [thread overview]
Message-ID: <45E392E8.1010908@zytor.com> (raw)
In-Reply-To: <3E0E2D98-5FEC-403E-831F-2B5BE6A3281A@mac.com>
Kyle Moffett wrote:
>
> Not a bad idea, but it could use some extra error checking to make sure
> that somebody remembers to "#define __kstruct_foo" before "#include
> <linux/foo.h>" (perhaps indirectly through linux/bar.h). Maybe
> something like this (plays nice with the very-basic unifdef parsing too):
>
> #ifdef __KERNEL__
> # define __kstruct_stat stat
> # define __kstruct_foo foo
> # define __kstruct_bar bar
> #endif
>
> #ifdef __LINUX_KERNEL_EXPORT
> # define __kstruct_stat stat
> # define __kstruct_foo foo
> # define __kstruct_bar bar
> #endif
>
> #ifndef __kstruct_stat
> # error "Missing definition of __kstruct_stat, please insert:"
> # error " #define __kstruct_stat <name-for-stat-struct>"
> # error "into your C file before '#include <linux/foo.h>'"
> #endif
> struct __kstruct_stat {
> }
>
> Someone who wanted to keep the name __kstruct_stat could of course
> "#define __kstruct_stat __kstruct_stat" easily.
>
True, but if someone makes errors on that level in your libc, don't you
think the fact that gcc will throw an error is sufficient? Writing that
kind of error generators is a lot of work, and probably for little gain.
-hpa
prev parent reply other threads:[~2007-02-27 2:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-23 18:43 include/linux/xattr.h: how much userpace visible? Adrian Bunk
2006-07-23 19:26 ` Alexey Dobriyan
2006-07-23 22:57 ` Nathan Scott
2006-07-24 18:31 ` Andreas Gruenbacher
2006-07-24 18:45 ` Sam Ravnborg
2006-07-24 18:58 ` Andreas Gruenbacher
2007-02-26 23:29 ` H. Peter Anvin
2007-02-26 23:28 ` H. Peter Anvin
2007-02-26 23:43 ` David Miller
2007-02-26 23:52 ` H. Peter Anvin
2007-02-27 0:03 ` Christoph Hellwig
2007-02-27 0:10 ` H. Peter Anvin
2007-02-27 1:49 ` Kyle Moffett
2007-02-27 2:09 ` H. Peter Anvin [this message]
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=45E392E8.1010908@zytor.com \
--to=hpa@zytor.com \
--cc=a.gruenbacher@computer.org \
--cc=bunk@stusta.de \
--cc=davem@davemloft.net \
--cc=dwmw2@infradead.org \
--cc=hch@infradead.org \
--cc=jmorris@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mrmacman_g4@mac.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