Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can never "handle" dereferencing a null pointer. Once you do this, your program is no longer in a well-defined state, and there is no way to continue deterministically. The only course of action is to <code>terminate()</code>, which the OS will kindly do on your behalf if you have not registered a SIGSEGV handler.</p> <p>The word "error" has several meanings which could possibly be confusing: On the one hand, a function that is unable to perform its expected task may be said to have encountered an "error", and it would be expected to signal this, either through a suitable return value, or by throwing an exception. This behaviour might better be called a <em>failure</em>. A correct program must be prepared to handle all possible ways in which a function may return. On the other hand, there are <em>programming errors</em> which simply lead to an wrong or even an ill-formed program. A correct program must never have any programming errors.</p> <p>For example, <code>malloc()</code> may <em>fail</em> (if it cannot find enough space), which it signals by returning a null pointer, but your program would be in error if it dereferenced the result of <code>malloc()</code> without checking.</p> <p>You can never "catch" or "handle" <em>programming errors</em> with further programming. Instead, a correct program must correctly anticipate and handle all <em>failure conditions</em> of component functions, and recursively a correctly written function must always return in a well-defined manner and signal failure appropriately.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload