From: SourceForge.net <no...@so...> - 2012-10-15 14:05:19
|
Bugs item #3513308, was opened at 2012-03-30 09:51 Message generated for change (Comment added) made by spth You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3513308&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Symbol scope level Group: None Status: Open Resolution: None >Priority: 7 Private: No Submitted By: Erik Petrich (epetrich) Assigned to: Nobody/Anonymous (nobody) Summary: Wrong variable used due to deferred symbol binding Initial Comment: In revision #7514: int foo(void) { int y = 1; { int x = y; int y = 2; return x; } } In the initialization of x, y should bind to the variable declared in the outer block (and will, if the declaration of y in the inner block is not present). but instead binds to the declaration of y in the inner block. The compiler notes that the inner y may be being used before initialization, does not actually apply the specified initial value to the inner y, but then returns the inner y's value since it believes that x was initialized with the inner y's value. ---------------------------------------------------------------------- >Comment By: Philipp Klaus Krause (spth) Date: 2012-10-15 07:05 Message: Increasing priority, since bad code is generated silently. Philipp ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3513308&group_id=599 |