This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/21749] gcc generates wrong code
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 May 2005 12:05:35 -0000
- Subject: [Bug c/21749] gcc generates wrong code
- References: <20050525114504.21749.sunmoon1997@gmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-25 12:05 -------
This is undefined code:
test_t test_struct[]= {
{
.name = s[i] = get_rand_str(),
.num = i++,
},
{
.name = s[i] = get_rand_str(),
.num = i++,
},
{
.name = s[i] = get_rand_str(),
.num = i++,
},
{
.name = s[i] = get_rand_str(),
.num = i++,
},
{
.name = s[i] = get_rand_str(),
.num = i++,
},
};
the order which i++ and get_rand_str() is called is undefined.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21749