Martin Sebor <msebor at gcc dot> changed:

           What    |Removed                     |Added
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |msebor at gcc dot
         Resolution|---                         |INVALID

--- Comment #1 from Martin Sebor <msebor at gcc dot> ---
The warning is intended (and designed to trigger across inlined function
calls).  The call to snprintf() truncates the string which may be unintended.

To avoid the warning either use the return value of the snprintf function to
take some action (i.e., handle the truncation) or use the len argument to
specify the precision of the %s directive like so:

    snprintf (b, sizeof b, "%.*s", (int)len, s);

Reply via email to