Menu

#55 splint fails to parse concatenated format strings to printf

open
nobody
5
2013-09-09
2013-09-09
Dirk
No

splint cannot parse format strings where a format specifier is split up between two string literals that are concatenated.

example: depending on OS we have a type for word sized values, this gets a format specifier depending also on OS like so:

#define LD "ld"

which is later used as follows:
printf("%3"LD"\n", wordsizevar);

splint seems to parse everything after a % literaly until it finds the end of a format specifier and sure enough %3""ld" is not a correct format specifier.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB