4 ms·
> It's better to accept that C (and C++) are only portable in theory, in reality it's nearly impossible to write non-trivial code which compiles without warning
by saagarjha 6y ago
> It's better to accept that C (and C++) are only portable in theory, in reality it's nearly impossible to write non-trivial code which compiles without warnings in a different compiler or runs out of the box on a different hardware architecture
It’s not that hard, unless you’re using -Wall or similar. And usually a platform that warns about something is probably giving decent advice anyways, regardless of whether the warning shows up elsewhere.
- flohofwoe 6y agoOf course. I guess what I wanted to say is: There's no way around testing your code on all compilers and platforms where that code is expected to run. There will always be new warnings and unpexted portability problems. Fixing those makes the code more robust. The language standard can only help a limited amount.