title: GCC warns about sign conversion on FD_SET call
body: <p>I'm trying to compile a network application on Ubuntu 12.04 using GCC and glibc 2.15
  Let's consider the following code as the example:</p>
  
  <p>a.cpp:</p>
  
  <pre><code>#include &lt;sys/select.h&gt;
  void func ()
  {
    int fd;
    fd_set fds;
    FD_SET(fd, &amp;fds);
  }
  </code></pre>
  
  <p>I can successfully compile these lines with the command "gcc -c -Wsign-conversion a.cpp", but I have the following warning after I add either -O1 or -O2 option:</p>
  
  <pre><code>gcc -c -O1 -Wsign-conversion a.cpp
  a.cpp:6: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
  </code></pre>
  
  <p>I have the warning for both gcc 4.4, 4.5 and 4.6.</p>
  
  <p>UPD: If I understand correctly, my example strictly conforms to FD_SET semantics, so I should have no warnings in this case.</p>
  
  <p>What's the reason of this? How can I avoid it?</p>
  
  <p>Thanks.</p>
  
  <p>UPD: Looks like it's the known issue now - <a href="http://comments.gmane.org/gmane.comp.lib.glibc.alpha/22344" rel="nofollow">http://comments.gmane.org/gmane.comp.lib.glibc.alpha/22344</a> . But I can't understand what should I do with it on GLIBC 2.15? Just wait for the next GLIBC?</p>