7: ERRORS AT DIFFERENT STAGES OF C++

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/27

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

28 Terms

1
New cards

Types of Errors

  1. Preprocessing Stage Errors

  2. Compilation Stage Errors

  3. Assembly Stage Errors

  4. Linking Stage Errors

  5. Runtime Errors

  6. Logical Errors

2
New cards

Preprocessing Stage Errors

  • Happens before actual compilation, while handling #include, #define, and macros

3
New cards

Common Preprocessing Stage Errors

  1. Missing Header Files

  2. Incorrect Macro Usage

4
New cards

Missing Header Files

Incorrect Macro Usage

Common Preprocessing Stage Errors

5
New cards

Missing Header Files

knowt flashcard image
6
New cards

Incorrect Macro Usage

knowt flashcard image
7
New cards

Compilation Stage Errors

  • ___ checks grammar (syntax) and mean (semantics)

  • Also called “Syntax and Sematic Errors”

8
New cards

Syntax and Sematic Errors

Compilation Stage Errors

9
New cards

Common Compilation Stage Errors

  1. Syntax Errors

  2. Undeclared Variables

  3. Type Mismatch

10
New cards

Syntax Errors

Undeclared Variables

Type Mismatch

Common Compilation Stage Errors

11
New cards

Syntax Errors

<p></p>
12
New cards

Undeclared Variables

knowt flashcard image
13
New cards

Type Mismatch

knowt flashcard image
14
New cards

Assembly Stage Errors

  • Rare, since this stage just translates complier output into machine code

  • Possible Issue: If the complier generates something the assembler cannot understand (unlikely modern compliers)

15
New cards

Linking Stage Errors

Happens when combining object files and libraries

16
New cards

Common Linking Stage Errors

  1. Undefined References

  2. Multiple Definitions

  3. Missing Library

17
New cards

Undefined References

Multiple Definitions

Missing Library

Common Linking Stage Errors

18
New cards

Undefined References

knowt flashcard image
19
New cards

Multiple Definitions

knowt flashcard image
20
New cards

Missing Library

  • If you use math functions but forget to link the math library (in old compliers)

21
New cards

Runtime Errors

  • Program compiles and links successfully, but crashes or misbehaves while running

22
New cards

Common Runtime Errors

  1. Divide by 0

  2. Null Point Dereference

  3. Memory Leak

23
New cards

Divide by 0

Null Point Dereference

Memory Leak

Common Runtime Errors

24
New cards

Divide by 0

knowt flashcard image
25
New cards

Null Point Dereference

knowt flashcard image
26
New cards

Memory Leak

  • Not freeing memory with delete/free

27
New cards

Logical Errors

The program runs, but produces the wrong output (hardest to detect)

28
New cards

Logical Error

knowt flashcard image