public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/12651] New: Able to use a variable before it is defined
@ 2003-10-16 21:42 erickt at andrew dot cmu dot edu
  2003-10-16 21:46 ` [Bug c/12651] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: erickt at andrew dot cmu dot edu @ 2003-10-16 21:42 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12651

           Summary: Able to use a variable before it is defined
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: erickt at andrew dot cmu dot edu
                CC: gcc-bugs at gcc dot gnu dot org

int main ()
{
     int i = i + 5;

     return 0;
}

compiles with:
gcc -Wall foo.c -o foo;

Is valid code. This appears to work with any variable.
I think there should be a warning, or compile error to prevent this from occuring.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/12651] Able to use a variable before it is defined
  2003-10-16 21:42 [Bug c/12651] New: Able to use a variable before it is defined erickt at andrew dot cmu dot edu
@ 2003-10-16 21:46 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-16 21:46 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12651


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-16 21:46 -------
This is a already fixed on the mainline by warning that the variable is uninitialized.
This is a dup of bug 10538.

*** This bug has been marked as a duplicate of 10538 ***


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-10-16 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-16 21:42 [Bug c/12651] New: Able to use a variable before it is defined erickt at andrew dot cmu dot edu
2003-10-16 21:46 ` [Bug c/12651] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).