This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

If folk're happy with this, should I make similar changes to
"newlib/libc/sys/linux/sys/types.h"? Not sure I want to touch
"winsup/cygwin/include/sys/param.h"... :-P

Ta!
-- 
Nick Withers

Embedded Systems Programmer
Department of Nuclear Physics, Research School of Physics and Engineering
The Australian National University (CRICOS: 00120C)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]