Comment by raverbashing

3 years ago

Well, funny that the compiler sees no problem in removing a check (on compile time) of a value that is totally possible to obtain, on runtime

Isn’t the very base issue the program didn’t sanitize the input?

Just blindly accepting user input is universally bad methinks.

  • We might ask if gcc will feel like keeping the sanitizing checks or it will take them out due to some bout of language lawyering as well...

    • I'm not sure what you mean by 'keping the sanitizing check'?

      A C program is basically a bunch of bytes, and the C standard tells you what those bytes are supposed to mean. A compiler's job is to translate the bytes into whatever target language you fancy, and making sure to preserve the proscribed behaviour. And that's exactly what the compiler did.