mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-21 05:49:19 +08:00
5717262b8e
Compiling #include <sys/select.h> void f(int X) { fd_set set; FD_ZERO(&set); FD_SET(X,&set); FD_CLR(X+1,&set); (void)FD_ISSET(X+2,&set); } results in plenty of gcc warnings when compiled with -Wconversion -Wsign-conversion: fds.c:7:2: warning: conversion to ‘long unsigned int’ from ‘int’ may FD_SET(X,&set); ^~~~~~ [...] The unsigned NFDBITS macro combined with the signed 1L constant are causing lots of implicit signed/unsigned type conversions. Fix this by updating the FD_* macro code to the latest from FreeBSD and adding an (int) cast to _NFDBITS. As a side-effect, this fixes the visibility of NFDBITS and fds_bits (only if __BSD_VISIBLE). This also eliminates the old, outdated fd_set workaround. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>