Results 1 to 4 of 4

Thread: What is the difference between Undefined Behavior and Unspecified Behavior

  1. #1
    Join Date
    Feb 2009
    Posts
    45

    What is the difference between Undefined Behavior and Unspecified Behavior

    Can anyone suggest me the difference between the Undefined and Unspecified behaviour in C++, in C++ there are three well known locations where invented during the C standardization or are generally defined in some ANSI/ISO document. Is there really any difference between them or it is just two different terms.

  2. #2
    Join Date
    Jan 2006
    Posts
    211

    Re: What is the difference between Undefined Behavior and Unspecified Behavior

    Undefined behavior indicates that an implementation may behave unpredictably when a program reaches a certain state, performance from gaming platforms while also providing language abstractions that make it possible to deliver incredibly rich titles. which almost without exception is a result of a bug.

  3. #3
    Join Date
    Jan 2009
    Posts
    143

    Re: What is the difference between Undefined Behavior and Unspecified Behavior

    Undefined behaviour occurs when a program does something the result of which is not specified by the standard. In other words, invoking UndefinedBehavior is a BadThing, and almost(?) always is a programming error. Mostly in the form of "undefined behavior"---the behavior is undefined precisely so that a checking implementation can trap it. if you want to see the meaning of the statement as a binary relation on the set o states, or as a predicate transformer, the block as a function from the states of the program then the meaning of the statement is perfectly well defined and it's not different in essence than any other "well defined" statement.

  4. #4
    Join Date
    Oct 2008
    Posts
    134

    Re: What is the difference between Undefined Behavior and Unspecified Behavior

    Developers can unwittingly rely on unspecified or undefined behavior, because compilers are not obliged to report those errors (nor can they report errors in many cases). Implementation-defined behaviour is an action by a program the result of which is not defined by the standard, but which the implementation is required to document. And since Dijkstra's claim that determinism is at best a distraction and we ought to think non-deterministically.

Similar Threads

  1. strange cursor behavior
    By selif in forum Operating Systems
    Replies: 5
    Last Post: 08-03-2011, 07:48 PM
  2. Inconsistent behavior of mouse
    By Urvaksh in forum Hardware Peripherals
    Replies: 4
    Last Post: 09-12-2010, 10:19 AM
  3. what are the behavior of virus
    By Bindusar in forum Networking & Security
    Replies: 5
    Last Post: 18-12-2009, 05:13 AM
  4. Behavior of the buffers in Vim
    By Kingfisher in forum Windows Software
    Replies: 3
    Last Post: 11-12-2009, 12:37 PM
  5. How to set driver signing behavior
    By stephenx in forum Hardware Peripherals
    Replies: 3
    Last Post: 24-04-2009, 10:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •