[PATCH] Cygwin: Make <sys/cpuset.h> safe for c89 compilations

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Jul 3 10:56:04 GMT 2023


Hi Mark,

On Jul  3 02:27, Mark Geisert wrote:
> Hi Brian,
> 
> Brian Inglis wrote:
> > On 2023-07-03 00:17, Mark Geisert wrote:
> > > Three modifications to include/sys/cpuset.h:
> > > * Change C++-style comments to C-style also supported by C++
> > > * Change "inline" to "__inline" on code lines
> > > * Don't declare loop variables on for-loop init clauses
> > > 
> > > Tested by first reproducing the reported issue with home-grown test
> > > programs by compiling with gcc option "-std=c89", then compiling again
> > > using the modified <sys/cpuset.h>. Other "-std=" options tested too.
> > > 
> > > Addresses: https://cygwin.com/pipermail/cygwin-patches/2023q3/012308.html
> > > Fixes: 315e5fbd99ec ("Cygwin: Fix type mismatch on sys/cpuset.h")

Signed-off-by?

> > Does this patch need __inline defined e.g.
> > 
> >    +#include <sys/cdefs.h>
> > 
> > did you perhaps include this directly in your test cases?
> > 
> > > -static inline size_t
> > > +static __inline size_t
> > ...
> 
> No, not directly.  The test case with the shortest list of #includes has:
> #define _GNU_SOURCE
> #include <assert.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> #include <sys/cpuset.h>
> #include <sched.h>
> 
> So it's apparently defined by one of those or some sub-include.  But indeed
> it's not safe to depend on that so I will try harder to figure out what
> other occurrences of __inline in the Cygwin source tree are depending on for
> the definition.
> Thanks,

Great.


Thanks,
Corinna


More information about the Cygwin-patches mailing list