https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78913

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #4)
> 1) use the %.508s directive instead of %s, or
> 2) verify the snprintf return value is less than 512.

Whoops.  An off-by-one error.  I meant to follow that by:

> Of the two alternatives, (1) is the expected/recommended way to avoid both
> the truncation and the warning.  (2) is a possible enhancement that could
> also be used to suppress the warning (along with changing the code).

Reply via email to