From: Andreas Schwab <schwab@suse.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Matthew Wilcox <willy@debian.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] use size_t for the broken ioctl numbers
Date: Sun, 07 Sep 2003 19:34:36 +0200 [thread overview]
Message-ID: <jeekysjydv.fsf@sykes.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0309071024010.2977-100000@home.osdl.org> (Linus Torvalds's message of "Sun, 7 Sep 2003 10:29:28 -0700 (PDT)")
Linus Torvalds <torvalds@osdl.org> writes:
> On Sun, 7 Sep 2003, Andreas Schwab wrote:
>>
>> Here is a patch that enforces the use of types in the third argument. It
>> requires gcc >= 3.1 for the check to work, I couldn't find a method for
>> previous versions.
>
> Ehh, what's wrong with the obvious approach: declare a dummy variable. If
> it's not a type, then the declaration won't work.
>
> Ie, change the (sizeof(x)) to something like
>
> ({ x __dummy; sizeof(__dummy); })
>
> which should work with all compiler versions.
This won't work with array types, eg. in <linux/random.h>:
#define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next prev parent reply other threads:[~2003-09-07 17:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-07 6:22 [PATCH] use size_t for the broken ioctl numbers Matthew Wilcox
2003-09-07 16:48 ` Andreas Schwab
2003-09-07 17:29 ` Linus Torvalds
2003-09-07 17:34 ` Andreas Schwab [this message]
2003-09-08 13:10 ` Ingo Oeser
2003-09-08 12:38 ` Andries Brouwer
2003-09-08 15:13 ` Linus Torvalds
2003-09-08 18:40 ` Andries Brouwer
2003-09-08 18:54 ` Linus Torvalds
2003-09-08 19:28 ` Randy.Dunlap
2003-09-08 19:53 ` Jeff Garzik
2003-09-08 20:15 ` Linus Torvalds
2003-09-08 20:26 ` Dave Jones
2003-09-08 21:53 ` Jeff Garzik
2003-09-08 22:25 ` Dave Jones
2003-09-08 20:27 ` Andries Brouwer
2003-09-08 20:43 ` Linus Torvalds
2003-09-09 11:40 ` Jens Axboe
[not found] <tbGb.75d.15@gated-at.bofh.it>
[not found] ` <tbPO.7j9.5@gated-at.bofh.it>
2003-09-07 21:28 ` Arnd Bergmann
2003-09-07 23:15 ` Linus Torvalds
2003-09-07 23:21 ` Linus Torvalds
2003-09-08 13:03 ` Arnd Bergmann
2003-09-08 13:33 ` Andreas Schwab
2003-09-08 13:35 ` Andries Brouwer
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=jeekysjydv.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=willy@debian.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