Bug 10539 - g++ does not issue a warning on "int a = a + 1" statements.
Summary: g++ does not issue a warning on "int a = a + 1" statements.
Status: RESOLVED DUPLICATE of bug 10538
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: ---
Assignee: Gabriel Dos Reis
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2003-04-29 14:06 UTC by invi
Modified: 2003-06-12 00:03 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description invi 2003-04-29 14:06:00 UTC
The following code compiles without any warning:

void foo()
{
  int a = a + 1;
}

The variable "a" does not exist in the global name space, which means that the uninitialized local variable "a" is accessed. A warning like "access to uninitialized variable" would be appropriate.

Release:
g++-3.2.3

Environment:
Debian SID

How-To-Repeat:
See description.
Comment 1 Gabriel Dos Reis 2003-04-29 14:10:56 UTC
*** This bug has been marked as a duplicate of 10538 ***