[tech] Mac stuff
John West McKenna
john at ucc.gu.uwa.edu.au
Wed Apr 17 17:52:54 WST 2002
Andrew Bailey writes:
>[0] its a personal peeve of mine if I have to grep the source dir to find out
>the type of a variable. Like it sucks, pass your vars people please.
I fondly remember one project that I inherited. One bug was caused by some
code like this:
wait_for_esc()
{
int ch;
ch = 0;
while (ch!=27)
ch=get_key();
return 0;
}
The bug? Declaring ch as a local.
No function had a declared return type. The ones that should have been
void just returned 0. get_key() was one of them. It put the key it read
into the global ch.
John
More information about the tech
mailing list