GNAT Errors

Below is a list of GNAT errors and how to resolve the problem. Whenever appropriate we show a code example of what generates the error and what can be done to resolve it. At times, we point you to a specific source file in the compiler since those show you the perfect example of how a working version.

GNAT Error Last change on
assignment to "in" mode parameter not allowed 2011/02/02
attribute "unchecked_access" cannot be applied to a subprogram 2011/02/01
"end loop;" expected for "loop" at line <number> 2011/12/28
"end loop <name>;" expected 2011/12/28
end of file expected, file can have only one compilation unit 2011/02/21
expected private type "<type name>" defined at ...; found type "<type name>" defined at ... 2011/02/06
expected type "<name>" defined at <line#> found type "<name>" 2011/12/27
file name does not match unit name, should be "case_folding.adb" 2011/12/28
file "<package name>.ads" not found 2011/02/04
identifier cannot start/end with underline 2011/02/01
illegal abbreviation of keyword "constant" 2011/12/28
illegal operand for numeric conversion 2011/02/23
invalid operand types for operator "<operator>" 2011/03/14
invalid prefix in selected component "<variable name>" 2011/02/04
missing body for "<function name>" declared at <line number> 2011/02/06
missing operand 2011/12/28
missing "range" 2011/12/28
"<name>" is not visible 2011/03/14
"<name>" is undefined (more references follow) 2011/12/28
"<name>" is undefined (more references follow); possible misspelling of "<name>" 2011/02/05
"<name>" not declared in "<package>" 2011/02/05
No legal interpretation for operator "=" 2011/02/04
no legal interpretation for operator "=", use clause on "<package name>" would make operation legal 2011/02/01
not fully conformant with declaration at <line#> default expression for "<name>" does not match 2011/12/27
not type conformant with declaration at <line#> type of "<variable name>" does not match 2011/02/02
positional aggregate cannot have one component 2011/02/01
prefix for "length" attribute must be array 2011/02/01
"," should be ";" 2011/02/04
"<>" should be "/=" or "!=" should be "/=" 2011/12/28
value not in range of type "<name>" defined at <line number> "Constraint_Error" will be raised at run time 2012/01/12
warning: unreachable code 2011/02/14
warning: variable "<name>" is never read and never assigned 2011/02/12