| Louis S. van der Walt on Wed, 02 Apr 2003 13:18:30 +0200 (SAST) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| [Linux dev] Re: Just a quickie |
OK OK I was temporarily blinded by my own cleverness ;P What I meant was that with an OR statement once you have a true outcome nothing can change that fact, what I did not take into account is that some compilers might actually evaluate all the statements and then calculate the result - which in essence should not change the outcome but in my book are a seriously inefficient way of doing it. ;-) Cheers Louis -----Original Message----- From: Hendrik Visage [mailto:hvisage@xxxxxxxxxxxxxx] Sent: Wednesday, April 02, 2003 12:59 To: Dallas G Cc: hvisage@xxxxxxxxxxxxxx; Louis S. van der Walt; dev@xxxxxxxxxxxx Subject: Re: [Linux dev] Re: Just a quickie On Wed, Apr 02, 2003 at 12:54:27PM +0200, Dallas G wrote: > >> This is not language dependant, but a rule of logic which can not > be > >> implemented any other way. > > > >Please enlighten me on the statement above, as I see it as follows > > An OR is an OR, eighter way you look at it. :) > it doesnt matter which expression is true or false in an OR as by the > very nature you want eighter to satisfy your condition, if one wants > more specific the use a case statement. Yes, the question asked is related to the functions/statements inside the expressions that have side effects, and whether it can be assumed to be both executed or not. > thats the way i see it The problem is: "How does the compiler see it?" :) Relax, Have a cold one Hendrik