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

I’ve thought I’d found a compiler but maybe 5 times in my life and it has never actually been a compiler bug.

When I reflect on the ~25 years I’ve been programming C, all of the times I thought I’d found a compiler bug were in the first ~8 years. Dunning-Kruger hard at work :-/



I found one by accident with C++. It was a situation where class A had a protected field x, B inherited from A, and C was a friend of B. Can C access x?

GCC and Clang disagreed on this. Upon close reading, Clang was right, C should be able to access x.

(Why did I do this? C was a helper class for the purpose of running unit tests. Unit tests are supposed to poke around in stuff you wouldn't normally poke around in.)


I've encountered 1 in ~20 years. I don't even remember what it was, but I remember being shocked when I tracked it down and it actually was a compiler bug




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

Search: