Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



What is the difference between Undefined Behavior and Unspecified Behavior

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 30-07-2009
Member
 
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.

Reply With Quote
  #2  
Old 30-07-2009
Member
 
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.
Reply With Quote
  #3  
Old 30-07-2009
Member
 
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.
Reply With Quote
  #4  
Old 30-07-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What is the difference between Undefined Behavior and Unspecified Behavior"
Thread Thread Starter Forum Replies Last Post
strange cursor behavior selif Operating Systems 5 08-03-2011 07:48 PM
Inconsistent behavior of mouse Urvaksh Hardware Peripherals 4 09-12-2010 10:19 AM
what are the behavior of virus Bindusar Networking & Security 5 18-12-2009 05:13 AM
Behavior of the buffers in Vim Kingfisher Windows Software 3 11-12-2009 12:37 PM
How to set driver signing behavior stephenx Hardware Peripherals 3 24-04-2009 10:37 AM


All times are GMT +5.5. The time now is 12:38 PM.