From: Jamie Lokier <jamie@shareable.org>
To: "Kevin P. Fleming" <kpfleming@cox.net>
Cc: Arnd Bergmann <arnd@arndb.de>, Andreas Schwab <schwab@suse.de>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] new ioctl type checking causes gcc warning
Date: Sat, 13 Sep 2003 20:10:20 +0100 [thread overview]
Message-ID: <20030913191020.GD7404@mail.jlokier.co.uk> (raw)
In-Reply-To: <3F625A26.7050305@cox.net>
Kevin P. Fleming wrote:
> >I had tried that first, but found that there are places that
> >use asm/ioctl.h without including asm/posix_types.h first, so
> >size_t might not be declared. unsigned int (or unsigned long)
> >is the better alternative here. Does this look ok to everyone?
>
> After working on this some more this afternoon, I realize now that
> it's much better to have the typechecking in place than not, even for
> userspace. Maybe the best solution is to still leave the typechecking
> (don't wrap it in #ifdef __KERNEL__), and just
>
> #ifdef size_t
> extern size_t __invalid_size_argument_for_IOC;
> #else
> extern unsigned int __invalid_size_argument_for_IOC;
> #endif
What's wrong with __typeof__(sizeof(0))?
-- Jamie
prev parent reply other threads:[~2003-09-13 19:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-12 19:13 Kevin P. Fleming
2003-09-12 20:02 ` Andreas Schwab
2003-09-12 12:53 ` Arnd Bergmann
2003-09-12 23:43 ` Kevin P. Fleming
2003-09-13 0:22 ` Arnd Bergmann
2003-09-13 0:31 ` Kevin P. Fleming
2003-09-13 11:05 ` Arnd Bergmann
2003-09-13 13:17 ` Kevin P. Fleming
2003-09-13 19:10 ` Jamie Lokier [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=20030913191020.GD7404@mail.jlokier.co.uk \
--to=jamie@shareable.org \
--cc=arnd@arndb.de \
--cc=kpfleming@cox.net \
--cc=linux-kernel@vger.kernel.org \
--cc=schwab@suse.de \
/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
all inboxes | Powered by JetHome®