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 :)