Hacker News new | ask | show | jobs
by mdhughes 3136 days ago
When using a new version of a compiler, and existing code stops working, it is often a compiler error. When different compilers give different results, it is often a compiler error.

I've hit dozens or hundreds of these, across many languages for decades.

It's not the first thing to check, but once you verify the code is logically correct, that can be the only conclusion.

Compilers aren't excessively complex code, but all code has bugs.

1 comments

> When using a new version of a compiler, and existing code stops working, it is often a compiler error. When different compilers give different results, it is often a compiler error.

To be fair, sometimes that's because the compiler became more strict and your code had an error that wasn't being caught. Sometimes it's the compiler taking a more liberal stance on what "undefined behavior" is for performance reasons. In both cases, that would still a programmer error (and I think those are likely the more common case than an actual compiler error).