This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [v1] Add Reiwa era tests to time/tst-strftime3.c
- From: Carlos O'Donell <codonell at redhat dot com>
- To: DJ Delorie <dj at redhat dot com>, Steve Ellcey <sellcey at marvell dot com>
- Cc: libc-alpha at sourceware dot org, tamuki at linet dot gr dot jp, digitalfreak at lingonborough dot com
- Date: Wed, 3 Apr 2019 22:23:38 -0400
- Subject: Re: [v1] Add Reiwa era tests to time/tst-strftime3.c
- References: <xnh8ben48s.fsf@greed.delorie.com>
On 4/3/19 5:55 PM, DJ Delorie wrote:
Steve Ellcey <sellcey@marvell.com> writes:
tst-strftime3.c:443:62: error: ‘%s’ directive output may be truncated writing up to 49 bytes into a region of size between 0 and 30 [-Werror=format-truncation=]
Fixed thusly:
snprintf will only truncate the output if the data its given
is corrupted, but a truncated buffer will not match the
"pristine" data's buffer, which is all we need. So just
disable the warning via the DIAG macros.
Thank you for fixing this.
We can always circle back and change things later if we find a way
to do this without DIAG_* macros, but we should fix the regression
first and formost so people like Steve don't have their builds
impacted.
It is *always* OK to use DIAG_* macros in a sensible way like this
to unbreak the builds. We can always change it later.
Cheers,
Carlos.