Messages in this thread | | | From | Alan Cox <> | Subject | Re: ideas | Date | Fri, 10 May 1996 13:20:05 +0100 (BST) |
| |
> > Could you please clarify? > > /* very contrived example */ > int boolean_case(int n) > { > switch (n) { > case 0: /* do stuff to make n true */ return 0; break; > case 1: return 1; break; > } > } > > any value could get into this function. What then? It should at the > very least return some half-way reasonable value, if not print an error > message, when passed an unexpected input. G++ says warning: control > reached end of non-void function "function_name".
We cant afford to blow megabytes of memory on little messages and billions of extra checks that slow the machine down.
Alan
| |