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 12:24 PM, Florian Weimer wrote:
> * Carlos O'Donell:
>
>>> These functions should not be inline and have printf/nonnull attributes.
>>
>> Without inline the compiler will complain about unused functions.
>
> You could add __attribute__ ((unused)).
Fixed. I have no strong preference. Marked ((unused)).
>>> The condition needs to be !be_quiet || status != 0, otherwise
>>> be_quiet also disables fatal errors. This applies to
>>> record_error_at_line, too.
>>
>> Fixed this differently.
>>
>> Even fatal errors should be quiet of --quiet is used, that's the purpose.
>>
>> Added:
>>
>> if (status != 0)
>> exit (status)
>
> The manual page says that fatal errors are still reported. That's the
> existing behavior, as far as I can see.
Ah, I see your point.
OK, changed to report fatal errors.
>> Question: Should locale/programs/locale.c 'static int verbose;' become
>> 'int verbose'?
>
> What's the background of this question?
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`?
--
Cheers,
Carlos.