[PATCH] Make ffsl() and ffsll() BSD-visible

Sebastian Huber sebastian.huber@embedded-brains.de
Fri Sep 29 10:41:00 GMT 2017

On 29/09/17 07:44, Yaakov Selkowitz wrote:

> On 2017-09-29 00:33, Sebastian Huber wrote:
>> In glibc they are guarded by __USE_MISC and __USE_GNU, however, on
>> FreeBSD they are guarded by __BSD_VISIBLE.  In Newlib, __BSD_VISIBLE is
>> set to one by _GNU_SOURCE.
> ffsl{,l} are only guarded as GNU extensions in glibc:
> http://man7.org/linux/man-pages/man3/ffs.3.html

Ok, yes this is the case with a recent glibc. I first simply looked at 
the headers of my openSUSE 42.2 machine.

It was changed by:

commit 7b037c095e31c2396d0a9b0e6356bc566ee4812f
Author: Zack Weinberg <zackw@panix.com>
Date:   Wed Nov 16 16:20:26 2016 -0500

     Clean up redundancies between string.h and strings.h.

             * string/string.h [__USE_MISC]: Include strings.h.
             (__bzero, bcmp, bcopy, bzero, index, rindex)
             (strcasecmp, strncasecmp, strcasecmp_l, strncasecmp_l)
             (ffs, ffsl, ffsll): Don't declare.

             * string/strings.h: Do not suppress the file if string.h has
             already been included.
             (bcmp, bcopy, bzero, strcasecmp, strncasecmp): Add __nonnull
             (index, rindex): Define inline forwarders even if
             __CORRECT_ISO_CPP_STRING_H_PROTO is defined.
             (ffs): Use __attribute_const__.
             (ffsl, ffsll): Declare here.
             (strcasecmp_l, strncasecmp_l): Correct comments; these 
             have now been standardized.

             * include/string.h (__bzero): Declare here.

Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

More information about the Newlib mailing list