This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] sys/types.h: Avoid bit-manipulation of signed values
- From: Nick Withers <nick dot withers at anu dot edu dot au>
- To: <newlib at sourceware dot org>
- Date: Tue, 17 Nov 2015 09:57:53 +1100
- Subject: Re: [PATCH] sys/types.h: Avoid bit-manipulation of signed values
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp dot mailfrom=nick dot withers at anu dot edu dot au;
- References: <1447301487 dot 1005 dot 12 dot camel at anu dot edu dot au> <1447301650 dot 1005 dot 14 dot camel at anu dot edu dot au> <20151112125702 dot GD17435 at calimero dot vinschen dot de> <1447368147 dot 1197 dot 5 dot camel at anu dot edu dot au> <20151113095343 dot GA21792 at calimero dot vinschen dot de> <5645F761 dot 8070906 at embedded-brains dot de> <20151114095520 dot GA18580 at calimero dot vinschen dot de> <5649B565 dot 4000500 at embedded-brains dot de> <20151116115538 dot GA5533 at calimero dot vinschen dot de>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
On Mon, 2015-11-16 at 12:55 +0100, Corinna Vinschen wrote:
> On Nov 16 11:52, Sebastian Huber wrote:
> > On 14/11/15 10:55, Corinna Vinschen wrote:
> > > On Nov 13 15:44, Sebastian Huber wrote:
> > > > > On 13/11/15 10:53, Corinna Vinschen wrote:
> > > > > > > RTEMS guys, any input on how you handle this stuff? Do
> > > > > > > we have to stick
> > > > > > > to sys/types.h or shall we carefully rearrange the
> > > > > > > definitions to be
> > > > > > > better aligned with BSD, Linux, et al?
> > > > >
> > > > > It would be good to rearrange the definitions to be better
> > > > > aligned with BSD
> > > > > and Linux. My long term goal is to get rid of the RTEMS
> > > > > -specific param.h
> > > > > (newlib/libc/sys/rtems/include/sys/param.h).
> > > Sounds good. What about sys/select.h and the matching macros in
> > > sys/types.h?
> >
> > Newlib has currently no sys/select.h. RTEMS provides its own copy
> > of this
> > file. Do you plan to import a sys/select.h into Newlib and use it
> > for
> > Cygwin?
>
> Cygwin is using its own copy of sys/select.h. I hacked a bit on this
> and I came up with a sys/select.h which works for Cygwin and which
> might
> be ok for inclusion into newlib. See the attached patch. I removed
> the
> source patches required to make this work on Cygwin, so this patch
> only
> shows what affects all targets.
>
> Note especially:
>
> - I moved NBBY to sys/param.h.
>
> - Define howmany in sys/param.h.
>
> In sys/select.h, as on FreeBSD:
>
> - Use "8" instead of "NBBY" (avoids dependency to sys/param.h).
>
> - Redefine fd_mask as unsigned long, rather than signed long.
>
> - Use _howmany instead of howmany.
>
> Please have a look if these changes would be ok for you.
It won't address the issues I was harping about, but I'll send patch v2
once this has settled.
Cheers!
--
Nick Withers
Embedded Systems Programmer
Department of Nuclear Physics, Research School of Physics and Engineering
The Australian National University (CRICOS: 00120C)