This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix strftime build with GCC 8
- From: Rafal Luzynski <digitalfreak at lingonborough dot com>
- To: libc-alpha at sourceware dot org, Joseph Myers <joseph at codesourcery dot com>
- Date: Thu, 29 Jun 2017 00:51:06 +0200 (CEST)
- Subject: Re: Fix strftime build with GCC 8
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.20.1706271400410.15648@digraph.polyomino.org.uk>
- Reply-to: Rafal Luzynski <digitalfreak at lingonborough dot com>
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