Hacker News new | ask | show | jobs
by tgummerer 2905 days ago
Especially C++ compilers have undefined behavior
2 comments

Yes. But are you going to to use 3 to 5 or mote C++ compilers on a given project?

The worst part of these frontend issues is, ultimately, the UX can become inconsistent, if not mess. Given that nearly everyone interfaces via the visual UI, you'd think we'd have this sorted out by now.

If your project is a library, I'd expect that people are gonna use it with, like, maybe not 5 but probably 2 or 3 different compilers, and they're gonna be less diligent about upgrading their compiler versions than mainstream browser users.
Thanks. I wasn't thinking about it that way. Good point.

That said, the browser's impact on UX is essential. A lot more people use browsers than compilers. You'd think the UX would matter by now.

Does a single compiler work exactly the same on every architecture? :D
You're using the words wrong. The code may have undefined behaviour.

For example, a race condition is an UB. Compiler won't invent locks that were not specified by the programmer in a code with some raw threads. As a result, CPUs will trash the memory.