Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix format strings #2561
This is a series of commits cleaning up format specifiers for the curl_*printf functions as a preparation for the last commit where an attribute is added to show which arguments are the format string, and which are the format specifiers.
A few comments on some of the commits:
tests: Fix format specifiers - In unit1323.c, the exact types for the members of the timeval struct is not specified, perhaps I should have added a cast to avoid protential problems on other platforms?
Make sure format length is int - Apparently, the standard says field precision specifiers should be of type int. I just added a cast to the variables. I have no idea if there's a risk it will overflow or wrap...
Add attribute to teach Gcc about printf-functions - A big bummer is that curl printf extensions (such as %.-2f) now gives warnings). I was not able to figure out if there was a way tell gcc about these extensions. It also means anyone using curl/mprintf.h with nonstandard extensions will get a warning.
It seems travis builds spews out warnings about
Thanks for your work!
Yeah, I was afraid exactly something like this would happen. The curl printf() code is not exactly like the C90 one.
I'm afraid I think that might be the only solution that doesn't force us to do other ugly things to avoid those warnings. Your work still identified a number of improvements thanks to that!
Nah, I'm fine with having "fixing printf() modifiers" being a single one etc.