This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11633] g++ does not initialize structures when auto-increment variables are used
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jul 2003 23:36:51 -0000
- Subject: [Bug c++/11633] g++ does not initialize structures when auto-increment variables are used
- References: <20030722205341.11633.msimons@simons-clan.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11633
------- Additional Comments From bangerth at dealii dot org 2003-07-22 23:36 -------
Commas separating function call arguments are not sequence points, so
foo(x++, x++)
can really be evaluated in different ways. On the other hand, commas in
comma expressions as in
while (x++, x++)
_are_ sequence points, so the order of evaluation is defined. The only question
which I can't answer from the standard is whether commas in initializer expressions
are sequence points.
If the order of evaluation is undefined, then the fact that some compilers implement
one way of doing things is not a reason to rely on a feature. Likewise,
random changes to the code _may_ make the code do what you expect, but
the code still triggers undefined behavior and may break again with
the next compiler version. The only way around this is to make the code
use only well defined semantics.
W.