[Cs3] unspecified, undefined, implementation-defined

Mikhail Nesterenko mikhail at cs.kent.edu
Wed Sep 9 13:37:48 EDT 2015


CS3 students,

The three terms are related to what is stated in C++ standard

- undefined: explicitly stated in the standard as not having a
  definitive outcome. Examples include
 
  -- dereferencing a null-pointer
  -- accessing deallocated objects
  -- accessing an array past its boundary

  Oh, and the value of i++ + ++i is undefined

- unspecified: not specified in the standard altogether. Either
  missed, or left up to the implementer (of the compiler). For 
  example, the order of processing of the arguments in a function
  invocation (left or right, right-to-left, or random) is unspecified

- implementation-defined: explicitly specified in the standard as left
  up to the implementer. For example, the return value of sizeof(int).

My "arbitrary" is actually slang. I usually mean "undefined" by that.

Thanks,
-- 
Mikhail


More information about the cs3 mailing list