The perils of integer overflow

Straight from this Arch Linux forum thread, about the behaviour of integers that just don’t know when to stop, and the subsequent “undefined behaviour”: :-)

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.

Boy, was there ever a time to Laugh Out Loud!

About these ads

Os comentários estão fechados.