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: [v1] Add Reiwa era tests to time/tst-strftime3.c


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.


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