#303133* (?/35) ⚐Flag --
kazuo wrote:
ISO C99 says that overflow are "undefined behavior" i.e. anything can happen and its ok. Wrap around? OK Program abort? OK, Pregnant cat? OK.
--
Good thing it only applies to cats and not humans, otherwise bad programmers all over the world would have to have this conversation:
Girl: Are you sure it will be ok?
Guy: Don't worry, I know what I'm doing... my integers never overflow. Just relax and trust me.
*fast forward*
Guy: OH FSCK, OH FSCK, OH FSCK!
Girl: WHAT? What happened?
Guy: My program just crashed. I swear this has never happened to me before!
Girl: omg I can't believe I was so stupid. I knew I shouldn't have let you run that. My mother told me this would happen.
Guy: Hey, you wanted to run it just as much as I did. I don't remember you asking to check the source first. You were just as eager to "chmod +x" as I was.
Girl: Whatever. I'm never letting so much as compile code near me ever again.Comment: Arch Linux forums
|