
102 Chapter 5
Program 67: Let’s Play “Hide the Problem”
The following program dumps core with a floating-point divide error on UNIX.
This is puzzling because we do no floating-point operations.
In order to find the problem, we’ve put in a few
printf statements and dis-
covered that it’s happening somewhere before the function call. We can tell this
because we never see the “starting” message.
1 /************************************************
2 * Compute a simple average. Because this *
3 * takes a long time (?) we output some *
4 * chatter as we progress through the system. *
5 ************************************************/
6 #include <stdio.h>