home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.linux.misc      Linux-specific topics not covered by oth      135,536 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 135,393 of 135,536   
   The Natural Philosopher to Carlos E. R.   
   Re: For those arguing over languages...   
   13 Feb 26 10:11:22   
   
   From: tnp@invalid.invalid   
      
   On 12/02/2026 18:52, Carlos E. R. wrote:   
   > On 2026-02-12 18:23, Rich wrote:   
   >> Carlos E. R.  wrote:   
   >>> On 2026-02-12 13:38, The Natural Philosopher wrote:   
   >>>> On 11/02/2026 22:24, Carlos E. R. wrote:   
   >>>>> On 2026-02-11 19:50, Rich wrote:   
   >>>>>> c186282  wrote:   
   >>>>>>> On 2/10/26 04:09, The Natural Philosopher wrote:   
   >>>>>>>> ...more fuel on the fire...   
   >>>>>>>>   
   >   
   >   
   >   
   >>>> I think the point is that the compiler knows that isn't necessary, and   
   >>>> doesnt bother.   
   >>>>   
   >>>   
   >>> Then don't optimize. Optimization has always been somewhat problematic.   
   >>> Sometimes it introduced bugs that could not be debugged, because   
   >>> debugging altered the code, possibly removing the optimizations.   
   >>   
   >> It wasn't the optimizer causing the "skipping" of the rest of the   
   >> checks.  It was a byproduct of boolean short-circuiting of boolean   
   >> expressions.  Most languages only evaluate just enough of a complex   
   >> boolean expression to reach a true or false indication, then skip the   
   >> rest of the expression (yes, this is an 'optimization', but not by the   
   >> code optimizer but the language specification itself).   
   >>   
   >> The skipping of the remaining character checks in the example posted   
   >> here was due to this boolean short-circuit behavior.  Once the first   
   >> 'false' arrived for the first incorrect character, the compiled code   
   >> skipped over evaluating the boolean expression for subsequent   
   >> characters.  So -O0 (no optimizations) or -O3 (full optimizations) made   
   >> no difference, portions of the 'constant time execution' were skipped,   
   >> opening a timing side channel attack.   
   >   
   > Ah, yes, I remember that now. Can play havoc when one of the expression   
   > is actually a function and the later code relies on the prior execution   
   > of that code.   
   >   
   the keyword 'volatile' helps in this case   
      
   >   
   >   
      
   --   
   Truth welcomes investigation because truth knows investigation will lead   
   to converts. It is deception that uses all the other techniques.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca