This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/8184: undefined variable gcc3.0


>Number:         8184
>Category:       c++
>Synopsis:       undefined variable gcc3.0
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 10 04:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Ritesh goel
>Release:        3.0
>Organization:
>Environment:

>Description:
gcc is allowing the usage of variable outside the scope of if stmt, if that variable is defined inside the condition expression of that if stmt and used as th first token after the scope of that if stmt .
as in eg.
void func()
{

   if ( int i = 9)
      {
        //
       }
    i = 8;
}

this should be an error but gcc is allowing 
i am using gcc3.0
>How-To-Repeat:

>Fix:

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]