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


> Dnia 29 czerwiec 2017 o 00:56 Paul Eggert <eggert@cs.ucla.edu> napisał(a):
>
>
> Rafal Luzynski wrote:
> > wouldn't a simple compound expression do the work?
>
> It's better to use do-while in case the macro is used as a then-part of an
> if-statement, where a simple compound expression would cause a syntax error.

Wouldn't it expand to:

          if (modifier == L_('O'))
            goto bad_format;
          else
            {
              digits = 1 > width ? 1 : width;
              number_value = tp->tm_year + TM_YEAR_BASE;
              goto do_number;
            };

I can't see a syntax error unless GCC 8 is different.

> FWIW, the Gnulib copy of strftime has been using do-while for some time.

As I said before, this is not a huge difference and probably even the
binary code is not different.  Not worth fixing if you like the code
as it is.

Regards,

Rafal


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