This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 3/6] vfprintf: Define WORK_BUFFER_SIZE
- From: Florian Weimer <fweimer at redhat dot com>
- To: Paul Eggert <eggert at cs dot ucla dot edu>, libc-alpha at sourceware dot org
- Date: Tue, 03 Mar 2015 08:38:50 +0100
- Subject: Re: [PATCH 3/6] vfprintf: Define WORK_BUFFER_SIZE
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1425246936 dot git dot fweimer at redhat dot com> <eca7d9307beb107523be4450b90908162943994e dot 1425246936 dot git dot fweimer at redhat dot com> <54F5174F dot 7020907 at cs dot ucla dot edu>
On 03/03/2015 03:07 AM, Paul Eggert wrote:
> Florian Weimer wrote:
>> - CHAR_T work_buffer[1000];
>> +#define WORK_BUFFER_SIZE 1000
>> + CHAR_T work_buffer[WORK_BUFFER_SIZE];
>
> Another nit: I suggest avoiding the macro, as it's confusing when
> #defined inside a function body but intended to be used outside the
> function, and instead doing this at the top level:
>
> enum { WORK_BUFFER_SIZE = 1000 };
>
> The general idea is to use a macro only when necessary.
Good idea, thanks.
--
Florian Weimer / Red Hat Product Security