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

Bug#271062: marked as done (/usr/include/sys/select.h: fd_set warnings in C++)



Your message dated Tue, 13 Feb 2007 00:54:00 +0100
with message-id <20070212235400.GA24332@hades.madism.org>
and subject line Bug#271062: /usr/include/sys/select.h: fd_set warnings in C++
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
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
64c64
< #define	__FDMASK(d)	((__fd_mask) 1 << ((d) % __NFDBITS))
---
> #define	__FDMASK(d)	(1L << ((d) % __NFDBITS))

--- End Message ---
--- Begin Message ---
tag 271062 + wontfix
thanks

On Sat, Sep 11, 2004 at 11:21:16PM +0200, Jeroen T. Vermeulen wrote:
> On Sun, Sep 12, 2004 at 02:29:20AM +0900, GOTO Masanori wrote:
>  
> > Which compiler did you use?  It should not be happneded with gcc/g++.
> 
> It did.  I tried with g++ 3.3 and 3.4, and both give this warning.  I know
> g++ and gcc don't normally give warnings for the standard headers, but in
> this case the problem occurs in a macro, so the actual warning is located
> in the source file, not the header.

> One important fact I forgot to mention is that I enable a lot of warning
> options.  The warning does not occur with the default configuration, but I
> do get it with -Wold-style-cast.  Which is otherwise a perfectly reasonable
> option to use and doesn't evoke any other warnings in this 10,000-line
> project.

  It's a reasonable option when you do pure C++ code. sadly, libc
includes are obviously meant to be used in C, hence there will be quite
a lot of old style (wrt C++) casts, and it's not a reasonable
compilation option to use in that context.

  There is a lot of old style casts in the libc:
  (void) casts in pthread.h, various (unsigned/long/int) casts in
obstack.h, and an awful list of them in the netinet/ includes. To cite
only a few.

  If you use stock C includes, you're bound to meet such problems, and
well, you'll have to live with it. There is not always a workaround like
here, for most of them the alternative syntax would be
static_cast<foo>(...) which is not valid in C.

  We won't "fix" that, as it's not always doable anyway.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

Attachment: pgpNidpQ2_3hN.pgp
Description: PGP signature


--- End Message ---

Reply to: