[PATCH v2] Cygwin: Fix type mismatch on sys/cpuset.h

Brian Inglis Brian.Inglis@Shaw.ca
Sat Jul 1 15:21:01 GMT 2023


On 2023-07-01 08:20, Jon Turney wrote:
> On 14/03/2023 08:56, Mark Geisert wrote:
>> Addresses https://cygwin.com/pipermail/cygwin/2023-March/253220.html
>>
>> Take the opportunity to follow FreeBSD's and Linux's lead in recasting
>> macro inline code as calls to static inline functions.  This allows the
>> macros to be type-safe.  In addition, added a lower bound check to the
>> functions that use a cpu number to avoid a potential buffer underrun on
>> a bad argument.  h/t to Corinna for the advice on recasting.
>>
>> Fixes: 362b98b49af5 ("Cygwin: Implement CPU_SET(3) macros")

> There's been a couple of reports that this leads to compilation failures when 
> this header is included in -std=c89 mode.
> Solutions are probably something like:
> * Use __inline__ rather than inline
> * Don't use initial declaration inside the for loop's init-statement
> e.g. https://github.com/tinyproxy/tinyproxy/issues/499

/usr/include/sys/cdefs.h appears to support using __inline instead of __inline__ 
or inline, and is included many places __inline is used: it appears to be 
necessary, but may not be sufficient.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry


More information about the Cygwin-patches mailing list