Changeset 1588 for branches/GNU/src/gcc/bugs.html
- Timestamp:
- Nov 3, 2004, 6:47:21 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gcc/bugs.html
-
Property cvs2svn:cvs-rev
changed from
1.1.1.3
to1.1.1.4
r1587 r1588 391 391 </pre></blockquote> 392 392 393 <p>This problem occur ed in a number of variants; in <code>throw</code>393 <p>This problem occurred in a number of variants; in <code>throw</code> 394 394 statements, people also frequently put the object in parentheses.</p></dd> 395 395 … … 459 459 460 460 <dl> 461 <dt>Increment/decrement operator (<code>++</code>/<code>--</code>) not 462 working as expected - a <a href="http://gcc.gnu.org/PR11751">problem with 463 many variations</a>.</dt> 464 465 <dd><p>The following expressions have unpredictable results:</p> 466 <blockquote><pre> 467 x[i]=++i 468 foo(i,++i) 469 i*(++i) /* special case with foo=="operator*" */ 470 std::cout << i << ++i /* foo(foo(std::cout,i),++i) */ 471 </pre></blockquote> 472 <p>since the <code>i</code> without increment can be evaluated before or 473 after <code>++i</code>.</p> 474 475 <p>The C and C++ standards have the notion of "sequence points". Everything 476 that happens between two sequence points happens in an unspecified order, 477 but it has to happen after the first and before the second sequence point. 478 The end of a statement and a function call are examples for sequence points, 479 whereas assignments and the comma between function arguments are not.</p> 480 481 <p>Modifying a value twice between two sequence points as shown in the 482 following examples is even worse:</p> 483 <blockquote><pre> 484 i=++i 485 foo(++i,++i) 486 (++i)*(++i) /* special case with foo=="operator*" */ 487 std::cout << ++i << ++i /* foo(foo(std::cout,++i),++i) */ 488 </pre></blockquote> 489 <p>This leads to undefined behavior (i.e. the compiler can do 490 anything).</p></dd> 491 492 461 493 <dt>Casting does not work as expected when optimization is turned on.</dt> 462 494 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.