public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ioctl compile warnings in userspace
@ 2003-11-07 17:32 Johannes Stezenbach
  2003-11-09 13:24 ` Sven Luther
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Stezenbach @ 2003-11-07 17:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

Hi,

Debian unstable now has glibc 2.3.2 and includes kernel headers
from "2.5.999-test7-bk-8".

$ gcc --version
gcc (GCC) 3.3.2 (Debian)


When compiling my DVB test programs I get warnings like:

  test_stc.c:64: warning: signed and unsigned type in conditional expression

with test_stc.c:64 being:

        if (ioctl(dmxfd, DMX_GET_STC, &stc) == -1) {

Patch below fixes it for i386, but there are more platforms
which need fixing.


diff -ru linux-2.6.0-test9-bk8/include/asm-i386/ioctl.h linux-2.6.0-test9-bk8-fix/include/asm-i386/ioctl.h
--- linux-2.6.0-test9-bk8/include/asm-i386/ioctl.h	2003-11-07 18:03:23.000000000 +0100
+++ linux-2.6.0-test9-bk8-fix/include/asm-i386/ioctl.h	2003-11-07 18:03:53.000000000 +0100
@@ -53,7 +53,7 @@
 	 ((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)) ? \


Johannes

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ioctl compile warnings in userspace
  2003-11-07 17:32 [PATCH] ioctl compile warnings in userspace Johannes Stezenbach
@ 2003-11-09 13:24 ` Sven Luther
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Luther @ 2003-11-09 13:24 UTC (permalink / raw)
  To: Johannes Stezenbach, Linus Torvalds, linux-kernel

On Fri, Nov 07, 2003 at 06:32:05PM +0100, Johannes Stezenbach wrote:
> Hi,
> 
> Debian unstable now has glibc 2.3.2 and includes kernel headers
> from "2.5.999-test7-bk-8".
> 
> $ gcc --version
> gcc (GCC) 3.3.2 (Debian)

I also get this problem when compiling parted :

../../libparted/linux.c: In function `_device_get_length':
../../libparted/linux.c:407: error: parse error before '[' token
../../libparted/linux.c:407: warning: signed and unsigned type in conditional expression
make[4]: *** [linux.lo] Erreur 1

This error is due to the usage of BLKGETSIZE64 in linux/fs.h, which is
defined as :

  #define BLKGETSIZE64 _IOR(0x12,114,size_t)      /* return device size in bytes (u64 *arg) */

I understand that size_t should no more be used or something such, which
is way the _IOC_TYPECHECK(t) was introduced.

I believe that the error is due to :

  sizeof(t[1])

trying to do :

   sizeof(size_t[1])

Not sure though.

I guess the debian glibc should not use 2.6.0-test headers in its
unstable glibc, which will run on systems with 2.4.x kernels anyway.

Friendly,

Sven Luther

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-11-09 13:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-07 17:32 [PATCH] ioctl compile warnings in userspace Johannes Stezenbach
2003-11-09 13:24 ` Sven Luther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox