An image is worth a thousand words:
I know how to work around the problem. But how do I fix it in Microsoft, so that I don't even get the warning ?
EDIT:
- contrary to what others have been pointing out in the commments, this is specific to Microsoft system. I can run the exact same code on a linux machine, use it in the same version of VsCode with the same configurations (tasks.json and properties.json), with the same version of gcc, and I won't get these compiler warnings.
- the C standard I'm using is c17.
- trying to use format specifiers like "%z" (or even "%ll") in format-dependent functions (like printf and scanf) will trigger format compiler warnings, even in a fully updated (as of 08/2021) Windows 10 OS, with the latest mingw-64 toolchain (specifically, gcc 8.1.0 - which is the compiler being used here).
- the "compiler error" shown in the image is, in fact, just a format warning being treated as an error (to quote the compiler: " [-Werror=format=] ")
- thanks, "@the busybee". You tried to address the issue. It is, indeed, a nice work around, but it would affect development compatibility.
EDIT 2:
After running into format incompatibility problems that caused actual unexpected bugs (and after a terrible experince using GDB's advanced features on Windows, as well), I just decided to ditch out GNU for good on Windows. For C cross-platform development on a Windows machine, I'm using Clang now. So far, I'm 100% satisfied with the decision. Thank you everyone who took their time to help me out.