lkml.org 
[lkml]   [2006]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch 1/1] consolidate TRUE and FALSE
From
Date

Le 18/3/2006, "Jan Engelhardt" <jengelh@linux01.gwdg.de> a écrit:

>>
>>Isn't there a runtime cost converting all "non-false" values to a unique "true" (i.e. converting non-zero values to one) ?
>>
>
>Somewhat. The answer is "yes, but depends on usage". If you just
>write
>
> _Bool x = filthy_action();
> if(x)
>
>Then the compiler is smart enough to optimize 'x' away if it is not used
>somewhere else, therefore we do not pay a price for converting the return
>type of filthy_action (=int) to a _Bool.

Actually I find this behavior very good

Xavier

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-19 12:48    [W:0.063 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site