Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I'll have an issue.

Name: Anonymous 2022-11-26 0:04

Of /prog/rider of course.

Name: Undefined Behavior 2022-11-29 6:17

Falsehoods programmers believe about undefined behavior

Undefined behavior (UB) is a tricky concept in programming languages and compilers. Over the many years I've been an industry mentor for MIT's 6.172 Performance Engineering course, I've heard many misconceptions about what the compiler guarantees in the presence of UB. This is unfortunate but not surprising!

For a primer on undefined behavior and why we can't just "define all the behaviors," I highly recommend Chandler Carruth's talk "Garbage In, Garbage Out: Arguing about Undefined Behavior with Nasal Demons."

You might also be familiar with my Compiler Adventures blog series on how compiler optimizations work. An upcoming episode is about implementing optimizations that take advantage of undefined behavior like dividing by zero, where we'll see UB "from the other side."

Undefined behavior != implementation-defined behavior

https://predr.ag/blog/falsehoods-programmers-believe-about-undefined-behavior

onewd 73 points

At least it won't start playing Doom

GCC used to start NetHack, Rogue etc. for some implementation-defined behavior https://feross.org/gcc-ownage/?1?1

zjm555 42 points

A lot of these were truly surprising, but this one:

"If the program compiles without errors then it doesn't have UB."

Someone actually believes that? UB typically results in warnings at best...

SilentXwing 7 points

Exactly. Leaving a variable uninitialize (C++ for an example) can result in a warning from the compiler, but the compiler can still compile and create an executable with UB present.

https://old.reddit.com/r/programming/comments/z6y2n5/falsehoods_programmers_believe_about_undefined

Name: Anonymous 2022-12-01 3:36

Damn, I haven't played NetHack in years.

Name: NetHack In Years 2022-12-01 6:29

Play it again, Sam.

Name: Rogue 2022-12-01 7:13

I haven't kept up up with all that goreshit produces, but damn that's a lot of gore and not much shit.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List