Fix strftime build with GCC 8

Rafal Luzynski digitalfreak@lingonborough.com
Wed Jun 28 22:51:00 GMT 2017


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



More information about the Libc-alpha mailing list