lkml.org 
[lkml]   [2003]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] use size_t for the broken ioctl numbers

On Sun, 7 Sep 2003, Linus Torvalds wrote:
>
> On Sun, 7 Sep 2003, Arnd Bergmann wrote:
> >
> > How about changing (sizeof(x)) to (sizeof(x[1]))?
> > It will result in "parse error before `['" when x is not
> > a type or an array type.
>
> That sounds like a clever thing to do. Have you tested it with a full
> configuration?

In fact, what you'd want to do is not just verify that it compiles, but
also verify that the object code matches.

Because there _is_ one case where adding the [1] will still compile, but
generate wrong code: if the "size" argument to the _IOx() was not a type,
but a real actual array.

Now, that would have been a bug (or at least a misfeature) before too, but
the point of this whole thread was that some people used the _IOx() macros
incorrectly, so maybe such broken usage actually exists..

Linus

-
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: 2009-11-18 23:46    [W:0.041 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site