Implementation Errors

Page last updated 04/21/99

Categories of errors and warnings are detected during implementation

  1. Compiletime errors
  2. Warning
  3. Linktime errors
  4. Runtime errors
  5. Intent errors

You've probably experienced many errors, especially those detected at compiletime

The above is listed in order of difficulty in resolution.

 

 

 

Errors Detected at Compiletime

Generated while the compiler is processing the source code.

Compiler reports violations of syntax rules. For example given these general forms (syntax rules):

What should the compiler do when it is processing this source code?

int student Number; 

cin >> student;

 

 

 

Warnings generated by the compiler

The compiler generates warnings when it discovers somethings that is legal, but potentially problematic

Example:

double x, y, z ; 

y = 2 * x ; 

// Warning: x used before being initialized

// Warning: z declared but never used

 

 

 

 

Linktime Errors

Errors that occur while trying to put together (link) an executable program

For example, we must always have function main (Main or MAIN won't do).

 

 

 

 

 

Runtime Errors

Errors that occur at runtime, that is, while the program is running.

Examples: Invalid numeric input, division by 0, picking up a cookie that is not there.

 

 

 

Intent Errors

When the program does what you typed, not what you intended.

Imagine this code

cout <<"Enter sum: "; 

cin >> n; 

cout <<" Enter n: "; 

cin >> sum; 

average = sum / n; 

Whose responsibility is it to catch this error __ ?

 

 

 

When the software doesn't match the specification

If none of the preceding errors occur, the program may still not be right.

The working program may not match the specification because either