-
Self-Checking Projects
Matching students up with research projects is entertaining but difficult. The project has to be at the right level of difficulty, has to fit the student’s time frame, and has to interest the student. If grant money is going to be used to pay the student, the work has to fit into the funded project.…
-
INT_MIN % -1 = ?
If you spend much time testing compilers, you’ll run into some strange phenomena even in apparently simple areas like computer arithmetic. For example John Cook wrote a post today explaining why IEEE floats have two different values of zero. Integer arithmetic is generally a lot simpler than floating point math, but it still contains a…
-
Compilers and Termination Revisited
My earlier post C compilers Disprove Fermat’s Last Theorem generated a good amount of discussion both here and on Reddit. Unfortunately, the discussion was riddled with misunderstandings. Some of this was because the topic is subtle, but some was my fault: the post was intended to be lightweight and I failed to explain the underlying…
-
C Compilers Disprove Fermat’s Last Theorem
[Update: I wrote another post on this topic that may explain the underlying issues more clearly.] Obviously I’m not serious: compilers are bad at solving high-level math problems and also there is good reason to believe this theorem cannot be disproved. But I’m getting ahead of myself. Recently — for reasons that do not matter…
-
The Compiler Doesn’t Care About Your Intent
A misunderstanding that I sometimes run into when teaching programming is that the compiler can and should guess what the programmer means. This isn’t usually quite what people say, but it’s what they’re thinking. A great example appeared in a message sent to the avr-gcc mailing list. The poster had upgraded his version of GCC,…
-
200 Compiler Bugs
This morning I reported the 200th bug found by our compiler testing tool. It is a new way to crash GCC. The failure-inducing input is not pretty so I won’t give it here, but it can be found in GCC’s bugzilla. Although the testing tool is now entirely developed by some excellent PhD students, I…