This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/9] Use STRFMON_LDBL_IS_DBL instead of __ldbl_is_dbl.


On Mon, Mar 26, 2018 at 11:17 AM, Gabriel F. T. Gomes
<gabriel@inconstante.eti.br> wrote:
> On Wed, 07 Mar 2018, Zack Weinberg wrote:
>
>>       * include/monetary.h (STRFMON_LDBL_IS_DBL): New constant.
>>       (__vstrfmon_l): Rename to __vstrfmon_l_internal and add flags
>>       argument.
>
> Maybe mention that attribute_hidden was not required, thus removed?
>
> Is this another instance of the 'only needed when called both from inside
> and outside of glibc' argument (as pointed out in a previous message [1])?
>
> [1] https://sourceware.org/ml/libc-alpha/2018-03/msg00311.html

I was partially wrong about that, see the subsequent discussion
between me and Florian.  I'm in the process of revising this patchset
to get the hidden annotations 100% correct, and that's sent me down
two levels of rabbit hole...

The rules as I currently understand them are:

 - A function that is _only_ called from inside the DSO that defines
it should have its prototype declaration marked attribute_hidden; the
*_hidden_def and *_hidden_proto macros should not be used.
 - A function that is called from both inside and outside the DSO that
defines it needs two or possibly three names, depending on a bunch of
additional factors; the *_hidden_def and *_hidden_proto macros are for
this case.
 - A function that is _only_ called from _outside_ the DSO that
defines it should not use either attribute_hidden or
*_hidden_{def,proto}.

There are additional complications having to do with static linkage,
whether the function is part of the API exposed to applications,
whether it was specified in C89, and whether we're trying to write
internal code using this function to look like normal (application)
code.  It's a big mess, frankly.

>>+extern ssize_t __vstrfmon_l_internal (char *s, size_t maxsize, locale_t loc,
>>+                                      const char *format, va_list ap,
>>+                                      unsigned int flags);
>   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Spaces that could be converted to tabs.

Ugh.  I will have to go through the entire patchset and check for
these.  (My editor is set to indent exclusively with spaces, because
several other projects I contribute or have contributed to require
that; glibc is the exception.)

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]