This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] locale: Fix localedef exit code [BZ #22292]
On 10/13/2017 01:35 PM, Florian Weimer wrote:
> * Carlos O'Donell:
>
>> The static file-scope verbose will have a different definition of
>> verbose from the expected verbose used by record-status.h. Thus a
>> verbose enablement in locale will not turn on verbose printing in
>> record_verbose. There are no such instances of this *today* in
>> charmap.c and the other files used by locale AFAICT. So it doesn't
>> impact anything, but it should probably be 'int verbose' in
>> locale.c, but I'm not sure if I should change that or not, or leave
>> it static on purpose.
>>
>> OK with the above changes *and* leaving locale.c as `static int
>> verbose`?
>
> Maybe at a comment on either definition of the verbose variable?
I added a comment to locale.c's definition of verbose and explained
what's going on.
i.e.
/* Nonzero if verbose output is wanted. Note that this definition is
file-local in scope, and does not extended to uses of verbose in
record-status.h functions like record_verbose. This means that this
verbose will not enable record_verbose messages for uses from locale,
but it does for uses from localdef (where verbose is global). */
static int verbose;
I guess the text is not precisely accurate, since if you included
record-status.h directly, then it would work for those errors or
warnings you used in just locale.c, but the reader should get the
jist. I wasn't going to write 2 paragraphs about linkage.
> I think what you have now is a net improvement, so please go ahead and
> commit it.
Thanks. Pushed.
--
Cheers,
Carlos.