Re: [Vala] Why the temporary variables in the C code are usefull ?

Jacques-Pascal Deplaix wrote:
What are the side effects corrected by the temporary variables ?

Unwanted side effects can happen if you evaluate an expression more
than once, e.g. if you substituted the full expression for every
_tmp2_ in the C code.  Expressions with side-effects include function
calls and stuff which modifies variables, e.g. p++.  You don't want to
do 'p++' twice or call the function twice.

As the other poster said, C compilers are very good at optimising away
temporary variables.


 Jim Peters                  (_)/=\~/_(_)                 jim uazu net
                          (_)  /=\  ~/_  (_)
 UazĂș                  (_)    /=\    ~/_    (_)                http://
 in Peru            (_) ____ /=\ ____ ~/_ ____ (_)  

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]