view docs/ccguide/errors.appendix @ 691:ddf512f635d2

Ever so closer
author boisy
date Mon, 30 Dec 2002 03:52:24 +0000
parents 497d17b4b264
children c8fcb9426d8b
line wrap: on
line source

<appendix>
<title>Compiler Generated Error Messages</title>
<para>
Below is a list of the error messages that the C compiler generates,
and, if applicable, probable causes and K &amp; R Appendix A section
number (in parenthesis) to see for more specific information.
</para>
<variablelist>
<varlistentry><term>already a local variable</term>
<listitem>
<para>
Variable has already been declared at the current block level.
(8.1, 9.2)
</para>
</listitem>
</varlistentry>

<varlistentry><term>argument : &lt;text&gt;</term>
<listitem>
<para>
Error from preprocessor. Self-explanatory. Most common cause
of this error is not being able to find an include file.
</para>
</listitem>
</varlistentry>

<varlistentry><term>argument error</term>
<listitem>
<para>
Function argument declared as type struct, union or function.
Pointers to such types, however are allowed. (10.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>argument storage</term>
<listitem>
<para>
Function arguments may only be declared as storage class
register. (10.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>bad character</term>
<listitem>
<para>
A character not in the C character set (probably a control
char) was encountered in the source file. (2)
</para>
</listitem>
</varlistentry>

<varlistentry><term>both must be integral</term>
<listitem>
<para>
&gt;&gt; and &lt;&lt; operands cannot be FLOAT or DOUBLE. (7.5)
</para>
</listitem>
</varlistentry>

<varlistentry><term>break error</term>
<listitem>
<para>
The break statement is allowed only inside a while, do, for or
switch block. (9.8)
</para>
</listitem>
</varlistentry>

<varlistentry><term>can't take address</term>
<listitem>
<para>
&amp; operator not allowed in a register variable. Operand must
otherwise be an lvalue. (7.2)
</para>
</listitem>
</varlistentry>

<varlistentry><term>cannot cast</term>
<listitem>
<para>
Type result of cast cannot be FUNCTION or ARRAY. (7.2, 8.7)
</para>
</listitem>
</varlistentry>

<varlistentry><term>cannot evaluate size</term>
<listitem>
<para>
Could not determine size from declaration or initializer.
(8.6, 14.3)
</para>
</listitem>
</varlistentry>

<varlistentry><term>cannot initialize</term>
<listitem>
<para>
Storage class or type does not allow variable to be
initialized. (8.6)
</para>
</listitem>
</varlistentry>

<varlistentry><term>compiler trouble</term>
<listitem>
<para>
Compiler detedted something it couldn't handle. Try compiling
the program again. If this error still occurs, contact
Microware.
</para>
</listitem>
</varlistentry>

<varlistentry><term>condition needed</term>
<listitem>
<para>
While, do, for, switch and if statements require a condition
expression. (9.3)
</para>
</listitem>
</varlistentry>

<varlistentry><term>constant expression required</term>
<listitem>
<para>
Initializer expressions for statis or external variables cannot
reference variables. They may, however, refer to the address
of a previously declared variable. This installation allows no
initializer expressions unless all operands are of type INT or
CHAR (8.6)
</para>
</listitem>
</varlistentry>

<varlistentry><term>constant overflow</term>
<listitem>
<para>
Input numeric constant was too large for the implied or
explicit type. (2.6, [PDP-11])
</para>
</listitem>
</varlistentry>

<varlistentry><term>constant required</term>
<listitem>
<para>
Variables are not allowed for array dimensions or cases. (8.3,
8.7, 9.7)
</para>
</listitem>
</varlistentry>

<varlistentry><term>continue error</term>
<listitem>
<para>
The continue statement is allowed only inside a while, do, or
for block. (9.9)
</para>
</listitem>
</varlistentry>

<varlistentry><term>declaration mismatch</term>
<listitem>
<para>
This declaration conflicts with a previous one. This is
typically caused by declaring a function to return a non-integer
type after a reference has been made to the function.
Depending on the line structure of the declaration block, this
error may be reported on the line following the erroneous
declaration. (11, 11.1, 11.2)
</para>
</listitem>
</varlistentry>

<varlistentry><term>divide by zero</term>
<listitem>
<para>
Divide by zero occurred when evaluating a constant expression.
</para>
</listitem>
</varlistentry>

<varlistentry><term>? expected</term>
<listitem>
<para>
? is any character that was expected to appear here. Missing
semicolons or braces cause this error.
</para>
</listitem>
</varlistentry>

<varlistentry><term>expression missing</term>
<listitem>
<para>
An expression is required here.
</para>
</listitem>
</varlistentry>

<varlistentry><term>function header missing</term>
<listitem>
<para>
Statement or expression encountered outside a function.
Typically causes by mismatched braces. (10.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>function type error</term>
<listitem>
<para>
A function cannot be declared as returning an array, function,
struct, or union. (8.4, 10.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>function unfinished</term>
<listitem>
<para>
End-of-file encountered before the end of function definition.
(10.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>identifier missing</term>
<listitem>
<para>
Identifier name required here but none was found.
</para>
</listitem>
</varlistentry>

<varlistentry><term>illegal declaration</term>
<listitem>
<para>
Declarations are allowed only at the beginning of a block.
(9.2)
</para>
</listitem>
</varlistentry>

<varlistentry><term>label required</term>
<listitem>
<para>
Label name required on goto statement. (9.11)
</para>
</listitem>
</varlistentry>

<varlistentry><term>label undefined</term>
<listitem>
<para>
Goto to label not defined in the current function. (9.12)
</para>
</listitem>
</varlistentry>

<varlistentry><term>lvalue required</term>
<listitem>
<para>
Left side of assigment must be able to be "stored into".
Array names, functions, structs, etc. are no lvalues. (7.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>multiple defaults</term>
<listitem>
<para>
Only one default statement is allowed in a switch block. (9.7)
</para>
</listitem>
</varlistentry>

<varlistentry><term>multiple definition</term>
<listitem>
<para>
Identifier name was declared more than once in the same block
level (9.2, 11.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>must be integral</term>
<listitem>
<para>
Type of object required here must be type int, char or pointer.
</para>
</listitem>
</varlistentry>

<varlistentry><term>name clash</term>
<listitem>
<para>
Struct-union member and tag names must be mutually distinct.  (8.5)
</para>
</listitem>
</varlistentry>

<varlistentry><term>name in cast</term>
<listitem>
<para>
Identifier name found in a cast. Only types are allowed. (7.2, 8.7)
</para>
</listitem>
</varlistentry>

<varlistentry><term>named twice</term>
<listitem>
<para>
Names in a function parameter list may appear only once. (10.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>no 'if' for 'else'</term>
<listitem>
<para>
Else statement found with no matching if. This is typically
caused by extra or missing braces and/or semicolons. (9.3)
</para>
</listitem>
</varlistentry>

<varlistentry><term>no switch statement</term>
<listitem>
<para>
Case statements can only appear within a switch block. (9.7)
</para>
</listitem>
</varlistentry>

<varlistentry><term>not a function</term>
<listitem>
<para>
Primary in expression is not type "function returning...". If
this is really a function call, the function name was declared
differently elsewhere. (7.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>not an argument</term>
<listitem>
<para>
Name does not appear in the function parameter list. (10.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>operand expected</term>
<listitem>
<para>
Unary operators require one operand, binary operators two.
This is typically caused by misplaced parenthesis, casts or
operators. (7.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>out of memory</term>
<listitem>
<para>
Compiler dynamic memory overflow. The compiler requires
dynamic memory for symbol table entries, block level
declarations and code generation. Three major factors affect
this memory usage. Permanent declarations (those appearing on
the outer block level (used in include files)) must be
reserved from the dynamic memory for the duration of the
compilation of the file. Each { causes the compiler to perform
a block-level recursion which may involve "pushing down"
previous declarations which consume memory. Auto class
initializers require saving expression trees until past the
declarations which may be very memory-expensive if may exist.
Avoiding excessive declarations, both permanent and inside
compound statement blocks conserve memory. If this error
occurs on an auto initializer, try initializing the value in
the code body.
</para>
</listitem>
</varlistentry>

<varlistentry><term>pointer mismatch</term>
<listitem>
<para>
Pointers refer to different types. Use a case if required. (7.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>pointer or integer required</term>
<listitem>
<para>
A pointer (of any type) or integer is required to the left of
the '-&gt;' operator. (7.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>pointer required</term>
<listitem>
<para>
Pointer operand required with unary * operator. (7.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>primary expected</term>
<listitem>
<para>
Primary expression required here. (7.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>should be NULL</term>
<listitem>
<para>
Second and third expression of ?: conditional operator cannot
be pointers to different types. If both are pointers, they
must be of the same type or one of the two must be null. (7.13)
</para>
</listitem>
</varlistentry>

<varlistentry><term>**** STACK OVERFLOW ****</term>
<listitem>
<para>
Compiler stack has overflowed. Most likely cause is very deep
lock-level nesting or hundreds of switch cases.
</para>
</listitem>
</varlistentry>

<varlistentry><term>storage error</term>
<listitem>
<para>
Reg and auto storage classes mey only be used within functions.
(8.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>struct member mismatch</term>
<listitem>
<para>
Identical member names in two different structures must have
the same type and offset in both. (8.5)
</para>
</listitem>
</varlistentry>

<varlistentry><term>struct member required</term>
<listitem>
<para>
Identifier used with . and -&gt; operators must be a structure
member name. (7.1)
</para>
</listitem>
</varlistentry>

<varlistentry><term>struct syntax</term>
<listitem>
<para>
Brace, comma, etc. is missing in a struct declaration. (8.5)
</para>
</listitem>
</varlistentry>

<varlistentry><term>struct or union inappropiate</term>
<listitem>
<para>
Struct or union cannot be used in the context.
</para>
</listitem>
</varlistentry>

<varlistentry><term>syntax error</term>
<listitem>
<para>
Expression, declaration or statement is incorrectly formed.
</para>
</listitem>
</varlistentry>

<varlistentry><term>third expression missing</term>
<listitem>
<para>
? must be followed by a : with expression. This error may be
causes by unmatched parenthesis or other errors in the
expression. (7.13)
</para>
</listitem>
</varlistentry>

<varlistentry><term>too long</term>
<listitem>
<para>
Too many characters provided in a string initializing a
character array. (8.6)
</para>
</listitem>
</varlistentry>

<varlistentry><term>too many brackets</term>
<listitem>
<para>
Unmatched or unexpected brackets encountered processiong an
initializer. (8.6)
</para>
</listitem>
</varlistentry>

<varlistentry><term>too many elements</term>
<listitem>
<para>
More data items supplied for aggregate level in initializer
than members of the aggregate. (8.6)
</para>
</listitem>
</varlistentry>

<varlistentry><term>type error</term>
<listitem>
<para>
Compiler type matching error. Should never happen.
</para>
</listitem>
</varlistentry>

<varlistentry><term>type mismatch</term>
<listitem>
<para>
Types and/or operators in expression do not correspond. (6)
</para>
</listitem>
</varlistentry>

<varlistentry><term>typedef - not a variable</term>
<listitem>
<para>
Typedef type name cannot be used in this manner. (8.8)
</para>
</listitem>
</varlistentry>

<varlistentry><term>undeclared variable</term>
<listitem>
<para>
no declaration exists at any block level for this identifier.
</para>
</listitem>
</varlistentry>

<varlistentry><term>undefined structure</term>
<listitem>
<para>
Union or struct declaration refers to an undefined structure
name. (8.5)
</para>
</listitem>
</varlistentry>

<varlistentry><term>unions not allowed</term>
<listitem>
<para>
Cannot initialize union members. (8.6)
</para>
</listitem>
</varlistentry>

<varlistentry><term>unterminated character constant</term>
<listitem>
<para>
Unmatched ' character delimiters. (2.4.3)
</para>
</listitem>
</varlistentry>

<varlistentry><term>unterminated string</term>
<listitem>
<para>
Unmatched " string delimiters. (2.5)
</para>
</listitem>
</varlistentry>

<varlistentry><term>while expected</term>
<listitem>
<para>
No while found for do statement. (9.5)
</para>
</listitem>
</varlistentry>

</variablelist>
</appendix>