[PATCH] sys/types.h: Avoid bit-manipulation of signed values

Corinna Vinschen vinschen@redhat.com
Thu Nov 12 13:18:00 GMT 2015


On Nov 12 15:14, Nick Withers wrote:
> Sorry, let's try that again...
> 
> On Thu, 2015-11-12 at 15:11 +1100, Nick Withers wrote:
> > Hi all,
> > 
> > The patch below attempts to resolve potential undefined behaviour in
> > bit-manipulation in the FD_* macros, also clearing up the GCC warning
> > "conversion to 'unsigned int' from 'int' may change the sign of the
> > result" with -Wsign-conversion and an int FD parameter.

Sorry if I'm dense, but... all these macros (NBBY, FD_SETSIZE, howmany)
are defined using int values, not unsigned int values, in glibc and
everywhere else, e.g. X11/Xpoll.h, python2.7/pyport.h, etc.  I don't
think we should use different definitions which potentially collide.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20151112/ce394874/attachment.sig>


More information about the Newlib mailing list