This is the mail archive of the
mailing list for the glibc project.
Re: [v1] Add Reiwa era tests to time/tst-strftime3.c
On Apr 02 2019, DJ Delorie <email@example.com> wrote:
> Steve Ellcey <firstname.lastname@example.org> writes:
>> I am building ToT glibc with ToT gcc and during glibc testing I got
>> this error:
> Yup, Arjun noticed as well when trying in Rawhide. It's a wierd
> warning, too, because the *point* of snprintf is that it truncates the
> Arjun and I talked about a few options, but I think the simplest is to
> just shut gcc up... alternatives include far bigger buffers with
> sprintf, or xasprintf... but what's the point of snprintf at all then?
> diff --git a/time/tst-strftime3.c b/time/tst-strftime3.c
> index 32ce0d93e2..2a4c3ea398 100644
> --- a/time/tst-strftime3.c
> +++ b/time/tst-strftime3.c
> @@ -430,16 +430,21 @@ static void
> tm_to_printed (struct tm *tm, char *buffer)
> const char *wn;
> - char temp;
> + char temp;
> if (0 <= tm->tm_wday && tm->tm_wday <= 6)
> wn = weekday_name[tm->tm_wday];
Does it change anything if you make weekday_name const or static?
Andreas Schwab, SUSE Labs, email@example.com
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."