If that's a problem, use Go or another higher level language.
Isn't one of the supposed advantages of C that it works on many platforms?
The last 40 odd years have proven that it does work but what you write isn’t portable.
That’s not the case, if you take a bit of care. Look at STB for example (https://github.com/nothings/stb) -- I’ve successfully used STB functions on a bunch of different platforms. In both C and C++, even!
Ah yes the “if you take a bit of care” argument. Welcome to the 1% of C programmers club :)
I guess the programs that I write which work on Mac / Windows / Linux / Wasm / i686 / amd64 / armv7 / aarch64 are just a bad dream I had
Only because you know the platform specific nuances...