Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I hit a tricky compiler bug a few years back, only after the bad code had been released to the public. Fortunately the bug manifested as some wasted performance instead of anything too damaging.

The issue was that extern C functions didn’t have proper type checking of the parameters. The header said one thing, the cpp file something else, and they were very subtly different. The compiler didn’t complain. At runtime the caller would pass some values and the callee would get complete garbage, but only on 64-bit architectures. I tested on 32-bit at the time and never saw it myself until it was too late.

To be fair this one is mostly my own bug. I call it a compiler bug too because I expected the compiler to have my back and it didn’t.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: