c++/10539: g++ does not issue a warning on "int a = a + 1" statements.

invi@your.toilet.ch invi@your.toilet.ch
Tue Apr 29 14:06:00 GMT 2003


>Number:         10539
>Category:       c++
>Synopsis:       g++ does not issue a warning on "int a = a + 1" statements.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 29 14:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Remo Inverardi
>Release:        g++-3.2.3
>Organization:
>Environment:
Debian SID
>Description:
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.
>How-To-Repeat:
See description.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list