Bug 14739 - Silently allows initializing a variable to itself (int i = i + 1)
Summary: Silently allows initializing a variable to itself (int i = i + 1)
Status: RESOLVED DUPLICATE of bug 10538
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.3.3
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-26 04:22 UTC by Anders Kaseorg
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i386-redhat-linux
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 Anders Kaseorg 2004-03-26 04:22:38 UTC
If I wrote int i = i + 1, I'd expect to get an error or at least a warning, but
GCC doesn't give a peep even with -Wall. Instead it proceeds to increment an
uninitialized register and store it to i. Maybe there's some reason for this,
but I don't see it.

Tested with GCC 3.3.3-3 on Fedora Core development and 2.96-113 on Red Hat 7.3.
Comment 1 Andrew Pinski 2004-03-26 05:03:04 UTC
Yes because it is a dup of bug 10538 which is fixed in 3.4.0.  Thanks.

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