[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#271062: /usr/include/sys/select.h: fd_set warnings in C++

Package: libc6-dev
Version: 2.3.2.ds1-16
Severity: minor
File: /usr/include/sys/select.h
Tags: patch

The __FDMASK macro in <sys/select.h> casts the integer 1 to an __fd_mask
(which is required to be a long int).  This C-style cast yields a
warning in application code when compiling in C++, breaking builds that
treat warnings as errors.

Defining separate versions for C and C++, with different cast syntax,
would be unnecessarily bulky.  Instead, I would propose to turn the
constant "1" (int) into "1L" (long int) and remove the cast.

-- System Information:
Debian Release: 3.1
Architecture: powerpc (ppc)
Kernel: Linux 2.6.7-gcc34
Locale: LANG=en_IN, LC_CTYPE=en_IN

Versions of packages libc6-dev depends on:
ii  libc6                2.3.2.ds1-16        GNU C Library: Shared libraries an
ii  linux-kernel-headers 2.5.999-test7-bk-17 Linux Kernel Headers for developme

-- no debconf information
diff include/sys/select.h include-patched/sys/select.h
< #define	__FDMASK(d)	((__fd_mask) 1 << ((d) % __NFDBITS))
> #define	__FDMASK(d)	(1L << ((d) % __NFDBITS))

Reply to: