Adds macros for compile time check of variadic format-like calls - #3087
ivan-mogilko merged 7 commits into
Conversation
159cec3 to
96a29b9
Compare
|
Looks like it finally builds everything now. I am curious if I should leave all individual fixes in many commits or if I should squash everything in a single "All: string format fixes" |
|
I have few notes about the macro declarations.
About the formatting fixes, I trust the compiler checks are correct to point about these mistakes. You may squash these commits if you like or leave them, as you prefer. I think critical fixes must be backported to earlier branches, like the one with the missing arguments. |
ah, ok, SDL does it too and I mostly copied the rest from them I guess I could name it as AGS_DISABLE_FORMAT_MACRO or AGS_DISABLE_FORMAT_CHECK |
32e081b to
6c2ea2f
Compare
6c2ea2f to
3fe1ffc
Compare
|
hey, I tried to move all the stuff that had to do with 64-bit/32-bit format like differences to a single last big commit, and left the other issues in separate commits before, in case you think anything there is worth porting over to some other branches. I tried also to address the previous comment, and I added an |
3fe1ffc to
aceee1b
Compare
fix variadic expansion in system debug printf with no args
fixes mostly lld that should be PRId64, zu/size_t and similar for proper 64-bit builds.
aceee1b to
ee8221d
Compare
Hey, I am trying to do what I mentioned in a comment
#3084 (comment)
This PR adds three macros that when used in the variadic function calls in ags, allow for type checking at compile time. Unfortunately (expectedly?) adding made me find a gazillion number of issues with the debug/log of stuff (mostly 32-bit / 64-bit builds mismatch). I haven't tested the SAL stuff on MSVC btw, I am mostly using the CI and macOS builds.
Edit: noticed I have no idea what these casts below mean, I fixed format errors in this file that I found in a different way.
ags/Common/font/wfnfont.cpp
Lines 69 to 70 in b443282