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]

[Bug c++/11633] g++ does not initialize structures when auto-increment variables are used


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.


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