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: Fix strftime build with GCC 8


27.06.2017 16:01 Joseph Myers <joseph@codesourcery.com> wrote:
> [...]
> +#define DO_NUMBER(d, v)                                \
> +         do                                    \
> +           {                                   \
> +             digits = d > width ? d : width;        \
> +             number_value = v;                 \
> +             goto do_number;                   \
> +           }                                   \
> +         while (0)

I know it's a little late to comment this as the patch is already
committed but wouldn't a simple compound expression do the work?
Like this:

#define DO_NUMBER(d, v)                                \
           {                                   \
             digits = d > width ? d : width;        \
             number_value = v;                 \
             goto do_number;                   \
           }

I mean without the surrounding do...while (0).

> +#define DO_NUMBER_SPACEPAD(d, v)               \
> +         do                                    \
> +           {                                   \
> +             digits = d > width ? d : width;        \
> +             number_value = v;                 \
> +             goto do_number_spacepad;          \
> +           }                                   \
> +         while (0)

Likewise.

Just asking, I haven't got GCC 8 to test it.

Feel free to ignore my comment if it is not worth fixing.  Your patch
is not harmful, though.

Regards,

Rafal


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