lkml.org 
[lkml]   [2003]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] new ioctl type checking causes gcc warning
Arnd Bergmann 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

Would the type specification of this non-existent variable ever
actually effect the generated code? If not, then even putting this
#ifdef in is overkill.

-
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-2011 Jasper Spaans