lkml.org 
[lkml]   [2003]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] 2.6.0-test9 ioctl compile warnings in userspace
    Hi,

    the patch below fixes

    warning: signed and unsigned type in conditional expression

    when compiling userspace programs with a glibc built against
    2.6 kernel headers.

    This is a better version of my previous patch which aims
    to fix all affected architectures.

    Johannes


    diff -rN -u4 linux-2.6.0-test9-bk17.orig/include/asm-i386/ioctl.h linux-2.6.0-test9-bk17/include/asm-i386/ioctl.h
    --- linux-2.6.0-test9-bk17.orig/include/asm-i386/ioctl.h 2003-11-12 16:49:14.000000000 +0100
    +++ linux-2.6.0-test9-bk17/include/asm-i386/ioctl.h 2003-11-12 16:51:38.000000000 +0100
    @@ -52,9 +52,9 @@
    ((nr) << _IOC_NRSHIFT) | \
    ((size) << _IOC_SIZESHIFT))

    /* provoke compile error for invalid uses of size argument */
    -extern int __invalid_size_argument_for_IOC;
    +extern unsigned int __invalid_size_argument_for_IOC;
    #define _IOC_TYPECHECK(t) \
    ((sizeof(t) == sizeof(t[1]) && \
    sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
    sizeof(t) : __invalid_size_argument_for_IOC)
    diff -rN -u4 linux-2.6.0-test9-bk17.orig/include/asm-parisc/ioctl.h linux-2.6.0-test9-bk17/include/asm-parisc/ioctl.h
    --- linux-2.6.0-test9-bk17.orig/include/asm-parisc/ioctl.h 2003-11-12 16:49:14.000000000 +0100
    +++ linux-2.6.0-test9-bk17/include/asm-parisc/ioctl.h 2003-11-12 16:51:24.000000000 +0100
    @@ -44,9 +44,9 @@
    ((nr) << _IOC_NRSHIFT) | \
    ((size) << _IOC_SIZESHIFT))

    /* provoke compile error for invalid uses of size argument */
    -extern int __invalid_size_argument_for_IOC;
    +extern unsigned int __invalid_size_argument_for_IOC;
    #define _IOC_TYPECHECK(t) \
    ((sizeof(t) == sizeof(t[1]) && \
    sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
    sizeof(t) : __invalid_size_argument_for_IOC)
    diff -rN -u4 linux-2.6.0-test9-bk17.orig/include/asm-ppc/ioctl.h linux-2.6.0-test9-bk17/include/asm-ppc/ioctl.h
    --- linux-2.6.0-test9-bk17.orig/include/asm-ppc/ioctl.h 2003-11-12 16:49:14.000000000 +0100
    +++ linux-2.6.0-test9-bk17/include/asm-ppc/ioctl.h 2003-11-12 16:51:34.000000000 +0100
    @@ -37,9 +37,9 @@
    ((nr) << _IOC_NRSHIFT) | \
    ((size) << _IOC_SIZESHIFT))

    /* provoke compile error for invalid uses of size argument */
    -extern int __invalid_size_argument_for_IOC;
    +extern unsigned int __invalid_size_argument_for_IOC;
    #define _IOC_TYPECHECK(t) \
    ((sizeof(t) == sizeof(t[1]) && \
    sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
    sizeof(t) : __invalid_size_argument_for_IOC)
    diff -rN -u4 linux-2.6.0-test9-bk17.orig/include/asm-ppc64/ioctl.h linux-2.6.0-test9-bk17/include/asm-ppc64/ioctl.h
    --- linux-2.6.0-test9-bk17.orig/include/asm-ppc64/ioctl.h 2003-11-12 16:49:14.000000000 +0100
    +++ linux-2.6.0-test9-bk17/include/asm-ppc64/ioctl.h 2003-11-12 16:51:28.000000000 +0100
    @@ -42,9 +42,9 @@
    ((nr) << _IOC_NRSHIFT) | \
    ((size) << _IOC_SIZESHIFT))

    /* provoke compile error for invalid uses of size argument */
    -extern int __invalid_size_argument_for_IOC;
    +extern unsigned int __invalid_size_argument_for_IOC;
    #define _IOC_TYPECHECK(t) \
    ((sizeof(t) == sizeof(t[1]) && \
    sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
    sizeof(t) : __invalid_size_argument_for_IOC)
    -
    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:58    [W:0.022 / U:117.628 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site