From: Anthony Liguori <aliguori@us.ibm.com>
To: Ian Campbell <Ian.Campbell@XenSource.com>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>,
xen-devel <xen-devel@lists.xensource.com>,
xen-ppc-devel@lists.xensource.com,
Hollis Blanchard <hollisb@us.ibm.com>,
John Levon <levon@movementarian.org>
Subject: Re: [patch] [3/3] dom0_ops explicitly sized types
Date: Fri, 26 May 2006 12:32:35 -0500 [thread overview]
Message-ID: <44773BB3.1020103@us.ibm.com> (raw)
In-Reply-To: <1148660853.24768.97.camel@localhost.localdomain>
Ian Campbell wrote:
>> If you use __u64, you'd need to include some header defining what __u64
>> is, so you're requiring another header anyways. You might as well use
>> the standard stdint.h rather than inventing your own.
>>
>
> As I understand it the issue is that the C spec makes the __* namespace
> available for the kernel to pollute and reserves the non-prefixed
> namespace for application usage. (Single underscore is for compiler or
> libc internals or something).
>
The relevant portions of the spec are:
7.1.3 Reserved identifiers
[#1] Each header declares or defines all identifiers listed
in its associated subclause, and optionally declares or
defines identifiers listed in its associated future library
directions subclause and identifiers which are always
reserved either for any use or for use as file scope
identifiers.
- All identifiers that begin with an underscore and
either an uppercase letter or another underscore are
always reserved for any use.
- All identifiers that begin with an underscore are
always reserved for use as macros and as identifiers
with file scope in both the ordinary and tag name
spaces.
- Each macro name in any of the following subclauses
(including the future library directions) is reserved
for use as specified if any of its associated headers
is included; unless explicitly stated otherwise (see
7.1.8 <http://www.vmunix.com/%7Egabor/c/draft.html#7.1.8>).
- All identifiers with external linkage in any of the
following subclauses (including the future library
directions) are always reserved for use as identifiers
with external linkage.133
- Each identifier with file scope listed in any of the
following subclauses (including the future library
directions) is reserved for use as macro and as an
identifier with file scope in the same name space if
any of its associated headers is included.
[#2] No other identifiers are reserved. If the program
declares or defines an identifier that is reserved in that
context (other than as allowed by 7.1.8 <http://www.vmunix.com/%7Egabor/c/draft.html#7.1.8>), the behavior is
undefined.134
It's pretty clear that __* names are reserved. The kernel is wrong
here. The best explanation I've gotten is "egocentrism" :-)
Regards,
Anthony Liguori
> An application which has not included stdint.h itself can expect to use
> uint64_t however it wishes, including making it a struct, a function or
> even something as gross as a 32 bit signed int etc. Exporting some other
> idea of what uint64_t should be via the kernel headers breaks this. I
> guess this is more of a problem when a kernel header gets indirectly
> included -- presumably an app which includes a kernel header directly
> knows what it is doing.
>
> Anyway, regardless of any opinion expressed here the Linux gatekeepers
> will no doubt insist on __uN. We might as well do it now as change it
> later.
>
> Ian.
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
next prev parent reply other threads:[~2006-05-26 17:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1148509900.26460.22.camel@basalt.austin.ibm.com>
2006-05-24 23:08 ` [patch] [1/3] global build configuration file Hollis Blanchard
2006-05-25 16:28 ` [XenPPC] " Hollis Blanchard
[not found] ` <1148511175.26460.35.camel@basalt.austin.ibm.com>
[not found] ` <1148511400.26460.39.camel@basalt.austin.ibm.com>
2006-05-24 23:04 ` [patch] [3/3] dom0_ops explicitly sized types Hollis Blanchard
2006-05-25 15:39 ` Muli Ben-Yehuda
2006-05-25 19:02 ` Hollis Blanchard
2006-05-26 13:32 ` Muli Ben-Yehuda
2006-05-26 14:28 ` Ian Campbell
2006-05-26 15:30 ` Hollis Blanchard
2006-05-26 16:27 ` Ian Campbell
2006-05-26 17:32 ` Anthony Liguori [this message]
2006-05-26 18:21 ` Markus Armbruster
2006-05-26 17:37 ` Hollis Blanchard
2006-05-26 18:57 ` Chris Wright
2006-05-26 19:38 ` John Levon
2006-05-26 19:57 ` Chris Wright
2006-05-27 0:42 ` John Levon
2006-05-24 23:09 ` [patch] [2/3] use new 'xen_pfn_t' type to represent PFNs in the Xen ABI Hollis Blanchard
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=44773BB3.1020103@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=Ian.Campbell@XenSource.com \
--cc=hollisb@us.ibm.com \
--cc=levon@movementarian.org \
--cc=muli@il.ibm.com \
--cc=xen-devel@lists.xensource.com \
--cc=xen-ppc-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.