2 ms·
Anywhere that this format is a variable, you probably already screwed up. C allows that, but if I see it that's getting flagged in my review. So long as the fo
by tialaramex 5y ago
Anywhere that this format is a variable, you probably already screwed up. C allows that, but if I see it that's getting flagged in my review.
So long as the format string is a literal you needn't care how it works.
Now, one of the places where C makes this nastier than it needed to be is that C built-in types are silly, and so any non-trivial program is using better fundamental types like uint32_t (or the more succinct u32), for which the built-in formatter offers no syntax. So you end up writing format strings like "There are "PRIu32" dogs\n" using macros to bring in the appropriate specifier for your literal. Blergh.