4 ms·
> One reason is locale-dependent format strings which are loaded from resource files. Aren't those usually resolved to string literals by preprocessor such th
by wyldfire 4y ago
> One reason is locale-dependent format strings which are loaded from resource files.
Aren't those usually resolved to string literals by preprocessor such that the compiler still could emit a warning?
- AnimalMuppet 4y agoThat might be possible if the "resource file" was processed at compile time. I've never seen a C toolchain that did it that way, though - I've only seen them read in at runtime. And at that point, the preprocessor can't save you.
- layer8 4y agoSince the locale is only determined at runtime, and might even change at runtime, the format strings are usually dynamically loaded from text files, and are not in the form of string literals seen by the compiler.