Ignore:
Timestamp:
Nov 3, 2004, 6:47:21 AM (21 years ago)
Author:
bird
Message:

GCC v3.3.5 - official sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gcc/bugs.html

    • Property cvs2svn:cvs-rev changed from 1.1.1.3 to 1.1.1.4
    r1587 r1588  
    391391</pre></blockquote>
    392392
    393 <p>This problem occured in a number of variants; in <code>throw</code>
     393<p>This problem occurred in a number of variants; in <code>throw</code>
    394394statements, people also frequently put the object in parentheses.</p></dd>
    395395
     
    459459
    460460<dl>
     461<dt>Increment/decrement operator (<code>++</code>/<code>--</code>) not
     462working as expected - a <a href="http://gcc.gnu.org/PR11751">problem with
     463many variations</a>.</dt>
     464
     465<dd><p>The following expressions have unpredictable results:</p>
     466<blockquote><pre>
     467x[i]=++i
     468foo(i,++i)
     469i*(++i)                 /* special case with foo=="operator*" */
     470std::cout &lt;&lt; i &lt;&lt; ++i   /* foo(foo(std::cout,i),++i)          */
     471</pre></blockquote>
     472<p>since the <code>i</code> without increment can be evaluated before or
     473after <code>++i</code>.</p>
     474
     475<p>The C and C++ standards have the notion of "sequence points". Everything
     476that happens between two sequence points happens in an unspecified order,
     477but it has to happen after the first and before the second sequence point.
     478The end of a statement and a function call are examples for sequence points,
     479whereas 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
     482following examples is even worse:</p>
     483<blockquote><pre>
     484i=++i
     485foo(++i,++i)
     486(++i)*(++i)               /* special case with foo=="operator*" */
     487std::cout &lt;&lt; ++i &lt;&lt; ++i   /* foo(foo(std::cout,++i),++i)        */
     488</pre></blockquote>
     489<p>This leads to undefined behavior (i.e. the compiler can do
     490anything).</p></dd>
     491
     492
    461493<dt>Casting does not work as expected when optimization is turned on.</dt>
    462494
Note: See TracChangeset for help on using the changeset viewer.