This is the mail archive of the gcc@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]

Re: gcc 3.3 / i386 / -O2 question


On Wed, 17 Nov 2004, Steven Bosscher wrote:

> Remember, "Undefined behavior" is not the same thing as "Unspecified
> behavior".  In the latter case, perhaps you're right.  Unspecified
> behavior should be consistent independent of the compiler options
> (and this behavior should be documented).  But for undefined behavior
> you shouldn't expect anything.

No, it's implementation-defined behavior that is documented.  Unspecified 
behavior has bounds of variation but need not be documented.  For example, 
in evaluating "x = f() + g()", the order in which f() and g() are 
evaluated is unspecified and could vary with compiler options, but their 
evaluation is not interleaved.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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