This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug hurd/14280] New: hurd ioctl request definitions produce warning: enumeral and non-enumeral type in conditional expression


http://sourceware.org/bugzilla/show_bug.cgi?id=14280

             Bug #: 14280
           Summary: hurd ioctl request definitions produce warning:
                    enumeral and non-enumeral type in conditional
                    expression
           Product: glibc
           Version: 2.15
            Status: NEW
          Severity: normal
          Priority: P2
         Component: hurd
        AssignedTo: unassigned@sourceware.org
        ReportedBy: andersk@mit.edu
                CC: roland@gnu.org, tschwinge@sourceware.org
    Classification: Unclassified


On HURD, any use of the ioctl request values defined in
sysdeps/mach/hurd/bits/ioctls.h (e.g. TIOCGWINSZ) produces this warning with
-Wextra:

warning: enumeral and non-enumeral type in conditional expression [enabled by
default]

Patch:

diff --git a/sysdeps/mach/hurd/bits/ioctls.h b/sysdeps/mach/hurd/bits/ioctls.h
index c4cfce6..7363173 100644
--- a/sysdeps/mach/hurd/bits/ioctls.h
+++ b/sysdeps/mach/hurd/bits/ioctls.h
@@ -141,7 +141,7 @@ enum __ioctl_datum { IOC_8, IOC_16, IOC_32, IOC_64 };

 /* Construct an individual type field for TYPE.  */
 #define _IOTS(type)    \
-  (sizeof (type) == 8 ? IOC_64 : (sizeof (type) >> 1))
+  (sizeof (type) == 8 ? (unsigned long) IOC_64 : (sizeof (type) >> 1))

 /* Construct a type information field for
    a single argument of the scalar TYPE.  */

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]