Fw: [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY

C Howland cc1964t@gmail.com
Tue Jan 18 16:10:44 GMT 2022


> ------------------------------
> *From:* Newlib <newlib-bounces+craig.howland=caci.com@sourceware.org> on
> behalf of Mike Frysinger <vapier@gentoo.org>
> *Sent:* Monday, January 17, 2022 11:47 PM
> *To:* newlib@sourceware.org <newlib@sourceware.org>
> *Subject:* [PATCH 1/8] newlib: internalize HAVE_INITFINI_ARRAY
>
>
>
> This define is only used by newlib internally, so stop exporting it
> as HAVE_INITFINI_ARRAY since this can conflict with defines packages
> use themselves.
>
> We don't really need to add _ to HAVE_INIT_FINI too since it isn't
> exported in newlib.h, but might as well be consistent here.
>
>
     How do you know it is only used by Newlib internally?  Changing this
is effectively changing the API and is not safe.  (I don't use it, myself,
but given it's been like this for a long time, there's nothing to say that
nobody is.)  Unfortunately, it uses a methodology as either being defined
or not, so someone using the #ifdef method on it would not immediately
notice the change. (That is, when building with something that looked at
it, the build itself could not know something had gone wrong.  It would
require runtime to find out.)
     This does not necessarily mean that this specific change ought not be
done, but it does mean that this consideration needs to be weighed before
an API-breaking change were made.  Offhand I can't think of a good way to
guard against it, either.  (A tedious way would be to mark it deprecated
and then remove it in a year or so.)
                         Craig


More information about the Newlib mailing list