snprintf is incorrectly annotated with PRINTFLIKE1
snprintf() is incorrectly annotated to be printf-like, because the first argument is indicated to be the format string, when in fact the 3rd argument is the format string. This annotation is used by lint to detect improper improper arguments passed to printf (when the format string is a string literal).
Thankfully, this mistake hasn't caused any errors to be introduced into the codebase, because the compiler (gcc -Wformat) also checks the arguments to snprintf (using a different, unknown mechanism to determine that the 3rd argument is the format string).
Updated by Electric Monk almost 6 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 3c5da275f68706f8301ea6c616a098430d84a71a Author: Matthew Ahrens <firstname.lastname@example.org> Date: 2016-11-07T06:28:19.000Z 7498 snprintf is incorrectly annotated with PRINTFLIKE1 Reviewed by: Sebastien Roy <email@example.com> Reviewed by: George Wilson <firstname.lastname@example.org> Reviewed by: Robert Mustacchi <email@example.com> Approved by: Gordon Ross <firstname.lastname@example.org>