← IGCSE Computer Science Paper 1

Compiler error reporting

A list of every error found after the compiler checks the whole program, with line numbers and error types. No executable is made and nothing runs until all are fixed.

Understanding Compiler error reporting in IGCSE Computer Science Paper 1

What it does: This report entry gives both the line number (7) and the error type (syntax error), which are the details a compiler's error report includes. Several errors from different parts of the program appear in one list because the whole code has been checked before the report is given. No executable was made while errors were present, so the student must compile the fixed code again. If there are no errors, an executable is produced.

Common mistakes: If the compiler finds errors it must not produce an executable file. Line 4 should set executable ← NONE, not create one. A compiler does not stop at the first error. It keeps going and lists every error in the report, so the STOP should be removed.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 430–439) and word search (Modules 419–439).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A compiler finds errors in a program. When does it show the errors?
It stops and shows only the first error, then waitsAfter it has checked the whole program, as one list
Matches
The compiler finds an error on line 4, stops, and shows only that one error. The program then runs the lines before it.
↓
A compiler does not stop at the first error or run part of the program. It checks the whole code, lists all the errors, and nothing runs.
Applying
Meanings
Term
compiler error report
Meaning
A list of every error found after the compiler checks the whole program, with line numbers and error types. No executable is made and nothing runs until all are fixed.
Practice
Compiling program...
Testing
Gaps
Compiler checks the program first,
Check Answer
Spots
3 OUTPUT report
4 executable ← CREATE(program)

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Warthog' badge — Definition Digger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A compiler finds errors in a program. When does it show the errors?
A. After it has checked the whole program, as one list ✓
B. It stops and shows only the first error, then waits
A compiler translates the whole program first, then gives an error report listing the errors found in the whole code.
2. A student compiles a program with 4 errors. What does the compiler report show?
A. All the errors listed together ✓
B. Only one error at a time
The compiler reports every error it found in the whole program in one go. This is different from an interpreter, which stops at the first error.
3. A compiler finds a syntax error on line 12. What is NOT produced?
A. The error report
B. The executable file ✓
If errors are found, no executable file is made. The compiler still produces the error report.
4. A program has errors. Can the student run it straight after compiling?
A. Yes, it runs up to the first error
B. No, the errors must be fixed first ✓
The program does not run until the errors are fixed and it has been compiled again without errors. A compiler does not run code part-way.
5. Which information does a compiler error report usually give?
A. The line number and the type of each error ✓
B. Only the total number of lines in the program
The report shows where each error is (the line number) and what kind it is (for example a syntax error), so the programmer can find and fix it.

Match the Pairs

Compiler error report: line 3 syntax error, line 9 syntax error, line 14 undeclared variable → The compiler checks the whole program and lists all the errors it found together, each with a line number and an error type
Compilation failed: 3 errors found. No executable file created. → The compiler found errors, so it does not produce an executable and the program cannot be run until the errors are fixed
The error report shows the line number and the type of each error, so the programmer knows where to look and what is wrong → Line 7: syntax error - missing closing bracket
A compiler reports all the errors from the whole program together, so the programmer can fix many errors before compiling again → Errors found: line 2, line 5, line 11, line 20
The compiler finds an error on line 4, stops, and shows only that one error. The program then runs the lines before it. → A compiler does not stop at the first error or run part of the program. It checks the whole code, lists all the errors, and nothing runs.
Compiler: 2 errors found. Executable file created. Program starts running. → If a compiler finds errors, no executable file is created, so the program cannot run until all the errors are fixed and it is compiled again.

Key Term

compiler error report
A list of every error found after the compiler checks the whole program, with line numbers and error types. No executable is made and nothing runs until all are fixed.

Fill in the Blanks

1. Compiler checks the whole program first, then lists all errors together in a report.
Hint: Type the word describing how much of the program the compiler checks before reporting errors
2. Errors found: 3 Executable file created: no
Hint: Type the short word that answers whether an executable is made when errors are found
3. Line 12: Syntax error: missing bracket
Hint: Type the type of error caused by breaking the rules of the language
4. 5 total = 10 + Error report: line 5 - incomplete sum
Hint: Type the line number of the faulty code shown above
5. IF errors > 0 THEN OUTPUT "No executable - fix errors"
Hint: Type the comparison operator meaning more than

Spot the Error

Question 1
A errors ← CHECK_WHOLE(program)
B IF errors > 0 THEN
C OUTPUT report
D executable ← CREATE(program)
E ENDIF
Line D — If the compiler finds errors it must not produce an executable file. Line 4 should set executable ← NONE, not create one.
Question 2
A report ← EMPTY LIST
B FOR EACH err IN allErrors
C ADD err TO report; STOP
D NEXT err
E OUTPUT report
Line C — A compiler does not stop at the first error. It keeps going and lists every error in the report, so the STOP should be removed.
Question 3
A Running shop.c ...
B Line 4: syntax error
C Line 9: undeclared variable
D 2 errors. No executable made.
Line A — A compiler translates the whole program first. It does not run it. The first line should say Compiling shop.c ... and not Running.
Question 4
A FOR EACH err IN report
B OUTPUT err.line
C OUTPUT err.time
D NEXT err
Line C — Each entry in a compiler error report shows the line number and the type of error. Line 3 should output err.type, not a time.
Question 5
A count ← 0
B FOR EACH err IN firstError
C count ← count + 1
D NEXT err
E OUTPUT count, " errors found"
Line B — The compiler checks the whole program and reports all the errors together. The loop must go through allErrors, not just the first error.

Student with a class code? Join your class →