lkml.org 
[lkml]   [1996]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: ideas
Date
> > 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





\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.372 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site