Message ID | 87eeq3zbtx.fsf@redhat.com |
---|---|
State | New |
Headers | show |
Series | RFA: Remove use of register keyword in libiberty.h | expand |
On 25 Jun 2020, Nick Clifton outgrape: > Hi Ian, Hi Nick, > > Comping the GOLD linker with Clang has started producing this error > message: > > In file included from gold/archive.cc:29: > include/libiberty.h:646:25: error: 'register' storage class > specifier is deprecated and incompatible with C++17 > [-Werror,-Wdeprecated-register] > > So I would like to apply the patch below to fix this. Is this OK ? Yes please! This was copied straight from bsearch.c, so you probably want to change bsearch.c and bsearch_r.c as well (just in case clang ever finds itself needing to build bsearch_r out of libiberty).
Hi Nick, Hi Ian, >> In file included from gold/archive.cc:29: >> include/libiberty.h:646:25: error: 'register' storage class >> specifier is deprecated and incompatible with C++17 >> [-Werror,-Wdeprecated-register] >> >> So I would like to apply the patch below to fix this. Is this OK ? > > Yes please! This was copied straight from bsearch.c, so you probably > want to change bsearch.c and bsearch_r.c as well (just in case clang > ever finds itself needing to build bsearch_r out of libiberty). OK, here is a revised patch. Ian - is this OK ? Cheers Nick include/ChangeLog 2020-06-25 Nick Clifton <nickc@redhat.com> * libiberty.h (bsearch_r): Remove use of the register keyword from the prototype. libiberty/ChangeLog 2020-06-25 Nick Clifton <nickc@redhat.com> * bsearch.c (bsearch): Remove use of register keyword. * bsearch_r.c (bsearch_r): Likewise.
Nick Clifton <nickc@redhat.com> writes: > Hi Nick, Hi Ian, >>> In file included from gold/archive.cc:29: >>> include/libiberty.h:646:25: error: 'register' storage class >>> specifier is deprecated and incompatible with C++17 >>> [-Werror,-Wdeprecated-register] >>> >>> So I would like to apply the patch below to fix this. Is this OK ? >> >> Yes please! This was copied straight from bsearch.c, so you probably >> want to change bsearch.c and bsearch_r.c as well (just in case clang >> ever finds itself needing to build bsearch_r out of libiberty). > > OK, here is a revised patch. Ian - is this OK ? > > Cheers > Nick > > include/ChangeLog > 2020-06-25 Nick Clifton <nickc@redhat.com> > > * libiberty.h (bsearch_r): Remove use of the register keyword from > the prototype. > > libiberty/ChangeLog > 2020-06-25 Nick Clifton <nickc@redhat.com> > > * bsearch.c (bsearch): Remove use of register keyword. > * bsearch_r.c (bsearch_r): Likewise. Sure, this is fine. Thanks. Ian
Hi Guys, >> include/ChangeLog >> 2020-06-25 Nick Clifton <nickc@redhat.com> >> >> * libiberty.h (bsearch_r): Remove use of the register keyword from >> the prototype. >> >> libiberty/ChangeLog >> 2020-06-25 Nick Clifton <nickc@redhat.com> >> >> * bsearch.c (bsearch): Remove use of register keyword. >> * bsearch_r.c (bsearch_r): Likewise. > > Sure, this is fine. Committed. Cheers Nick
diff --git a/include/libiberty.h b/include/libiberty.h index 0bb5b81d4a..591e9ac48d 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -643,9 +643,9 @@ extern int pwait (int, int *, int); /* Like bsearch, but takes and passes on an argument like qsort_r. */ -extern void *bsearch_r (register const void *, const void *, - size_t, register size_t, - register int (*)(const void *, const void *, void *), +extern void *bsearch_r (const void *, const void *, + size_t, size_t, + int (*)(const void *, const void *, void *), void *); #if defined(HAVE_DECL_ASPRINTF) && !HAVE_DECL_ASPRINTF