Always initialize your variables in C. It prevents a whole class of security and stability bugs. uid_t callerUID = 0; NO NO NO NO NO N—
Your development process doesn't have to be portable. It just has to warn you while you're developing.
-
-
C does not allow for a perfect warning system. For instance is x or y initialized here? int x, y; scanf("%x + %x", &x, &y);
-
Depends on return value of scanf. If you don't check it, code is unsafe. Static analysis can verify you checked right.
-
This hypothetical compiler seems to be pretty perfect. C ad petitio principii sounds lovely but is not a real-world development environment.
-
1) You assume that scanf() doesn't have bugs or UB of its own, 2) you assume that all such functions return a useful value, and 3) …
-
3) you assume that all such functions define the state of their inputs in all cases. In the real world, it is rarely safe to assume these.
-
Code is written by humans and humans make mistakes. Static analysis is an invaluable tool but they do not give you an omniscient compiler.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.