printf
printf copied to clipboard
Mark the *printf functions with __attribute__((format)).
See issue #79.
Codecov Report
Merging #80 into master will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #80 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 359 359
=========================================
Hits 359 359
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update d3b9846...d8aeaa9. Read the comment docs.
When the format attribute is added, we get a massive amounts of warnings from test_suite.cpp
, including:
warning: flag ' ' results in undefined behavior with 's' conversion specifier [-Wformat]
warning: format specifies type 'char' but the argument has type 'int' [-Wformat]
warning: invalid conversion specifier 'b' [-Wformat-invalid-specifier]
warning: flag '#' results in undefined behavior with 'u' conversion specifier [-Wformat]
Some can just be fixed by explicit casting (and TBH it's a bit surprising that they work... are we saved by the ABI perhaps?) ; others cannot.
What are your thoughts?...
Naturally, this is not my repository, but I've been thinking of merging this into my fork, which already has, merged, the work of some others around here (e.g. warning fixes, glibc %p behavior etc.). I even created a PR for that, but while merging I noticed all those warnings.
When the format attribute is added, we get a massive amounts of warnings from
test_suite.cpp
I believe I fixed this in my fork. See joshklod:format-attr
for my implementation of this feature.