-
- Downloads
Change declaration treatment to mimic C++
Actually in C++ `` double x = 3; { double x = x+1; } `` in the instruction, ``double x = x+1;``, the right-hand side `x` IS the left-hand side and not the global one, which lead to a "use of non-initialized" warning. It is not clear to me why the RHS x is not the global one, and I think the previous implementation was a possibility. One just can say that the chosen C++ policy implies that the above code is equivalent to `` double x = 3; { double x; x = x+1; } `` which was not the case for the previous pugs implementation, and that `x` is found in the local symbol table as soon as it is declared (right after the `=` symbol)
Please register or sign in to comment