lkml.org 
[lkml]   [2003]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] use size_t for the broken ioctl numbers
From
Date
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."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site