5
COMPILER DIAGNOSTICS
This chapter contains the following sections:
Introduction
Return Values
Errors and Warnings
5.1
Introduction
cc51 has three classes of messages: user errors, warnings
and internal compiler errors.
Some user error messages carry extra information, which is displayed
by the compiler after the normal message. The messages with extra information are marked with 'I' in the list below. They never appear without a previous error message and error number. The number of the information message is not important, and therefore, this number is
not displayed. A user error can also be fatal (marked as 'F' in the list
below), which means that the compiler aborts compilation immediately after displaying the error message and may generate a 'not complete' output file.
The error numbers and warning numbers are divided in two groups. The frontend part of the compiler uses numbers in the range 0 to 499,
whereas the backend (code generator) part of the compiler uses numbers in
the range 500 and higher. Note that most error messages and warning messages are produced by the frontend.
Errors can be written directly to an error list file by using the -err option of the compiler. See also the chapter Compiler Use.
If you program a non fatal error, cc51 displays the
C source line that contains the error, the error number and the error message on the
screen. If the error is generated by the code generator, the C source line
displayed always is the last line of the current C function, because code generation
is started when the end of the function is reached by the frontend. cc51 displays the line number causing the error before the error message.
cc51 always generates the error number in the assembly output file, exactly matching the place where the error occurred.
For example, the following program, bug.c, causes a code generator error message:
void
main(void)
{
char c;
_testclear( c );
}
E 544: (line 6) illegal testclear argument
The output file, bug.src, contains:
; bug.c 6 _testclear( c );
ERROR C51_ERROR_544
So, when a compilation is not successful, the generated output file
is not accepted by the assembler, thus preventing a corrupt application to
be made (see also the -e option).
Warning messages do not result in an erroneous assembly output file. They are meant to draw your attention to assumptions of the compiler,
for a not correct situation. You can control warning messages with the -w[num] option.
The last class of messages are the internal compiler errors. The following format is used:
S number: internal error - please report
These errors are caused by failed internal consistency checks and
should never occur. However, if such a 'SYSTEM' error appears, please report
the occurrence to TASKING, using a Problem Report form. Please include
a diskette or tape, containing a small C program causing the error.
5.2
Return Values
cc51 returns an exit status to the operating system
environment for testing.
For example,
in a MS-DOS BATCH-file you can examine the exit status of the program executed with ERRORLEVEL:
cc51 -s %1.c
IF ERRORLEVEL 1 GOTO STOP_BATCH
In a bourne shell script, the exit status can be found in the $? variable, for example:
cc51 $*
case $? in
0) echo ok ;;
1|2|3) echo error ;;
esac
The exit status of cc51 is one
of the numbers of the following list:
0 Compilation successful, no errors
1 There were user errors, but terminated normally
2 A fatal error, or System error occurred, premature ending
3 Stopped due to user abort
5.3
Errors and Warnings
Errors start with an error type, followed by a number and a message.
The error type is indicated by a letter:
I information
E error
F fatal error
S internal compiler error
W warning
Frontend
F 1 evaluation expired
Your product evaluation period has expired. Contact your local TASKING office for the official product.
W 2 unrecognized option: 'option'
The option you specified does not exist. Check the invocation syntax for the correct option.
E 4 expected number more '#endif'
The preprocessor part of the compiler found the'#if', '#ifdef' or
'#ifndef' dirctive but did not find a corresponding '#endif' in the same source file. Check your source file that each '#if', '#ifdef' or '#ifndef'
has a corresponding '#endif'.
E 5 no source modules
You must specify at least one source file to compile.
F 6 cannot create "file"
The output file or temporary file could not be created. Check if you have sufficient disk space and if you have write permissions in the specified directory.
F 7 cannot open "file"
Check if the file you specified really exists. Maybe you misspelled
the name, or the file is in another directory.
F 8 attempt to overwrite input file "file"
The output file must have a different name than the input file.
E 9 unterminated constant character or string
This error can occur when you specify a string without a closing double-quote (") or when you specify a character constant without a closing single-quote ('). This error message is often preceded by one or more E 19 error messages.
F 11 file stack overflow
This error occurs if the maximum nesting depth (50) of file inclusion
is reached. Check for #include files that contain other #include files.
Try to split the nested files into simpler files.
F 12 memory allocation error
All free space has been used. Free up some memory by removing any resident programs, divid the file into several smaller source files,
break expressions into smaller subexpressions or put in more memory.
W 13 prototype after forward call or old style declaration
- ignored
Check that a prototype for each function is present before the actual call.
E 14 ';' inserted
An expression statement needs a semicolon. For example, after
++i in { int i; ++i }.
E 15 missing filename after -o option
The -o option must be followed by an output filename.
E 16 bad numerical constant
A constant must conform to its syntax. For example,
08 violates
the octal digit syntax. Also, a constant may not be too large to be represented in the type to which it was assigned. For example, int i = 0x1234567890; is too large to fit in an integer.
E 17 string too long
This error occurs if the maximum string size (1500) is reached. Reduce the size of the string.
E 18 illegal character (0xhexnumber)
The character with the hexadecimal ASCII value 0xhexnumber
is not allowed here. For example, the '#' character, with hexadecimal value 0x23, to be used as a preprocessor command, may not be preceded by non-white space characters. The following is an example of this error:
char *s = #S ; // error
E 19 newline character in constant
The newline character can appear in a character constant or string constant only when it is preceded by a backslash (\). To break a string that is on two lines in the source file, do one of the following:
- End
the first line with the line-continuation character, a backslash (\).
- Close
the string on the first line with a double quotation mark, and open the string on the next line with another quotation mark.
E 20 empty character constant
A character contant must contain exactly one character. Empty character contants ('') are not allowed.
E 21 character constant overflow
A character contant must contain exactly one character. Note that
an escape sequence (for example, \t for tab) is converted
to a single character.
E 22 '#define' without valid identifier
You have to supply an identifier after a '#define'.
E 23 '#else' without '#if'
'#else' can only be used within a corresponding '#if', '#ifdef' or
'#ifndef' construct. Make sure that there is a '#if', '#ifdef' or '#ifndef'
statement in effect before this statement.
E 24 '#endif' without matching '#if'
'#endif' appeared without a matching '#if', '#ifdef' or '#ifndef' preprocessor directive. Make sure that there is a matching '#endif'
for each '#if', '#ifdef' and '#ifndef' statement.
E 25 missing or zero line number
'#line' requires a non-zero line number specification.
E 26 undefined control
A control line (line with a '#identifier') must contain
one of the known preprocessor directives.
W 27 unexpected text after control
'#ifdef' and '#ifndef' require only one identifier. Also, '#else'
and '#endif' only have a newline. '#undef' requires exactly one identifier.
W 28 empty program
The source file must contain at least one external definition. A source file with nothing but comments is considered an empty program.
E 29 bad '#include' syntax
A '#include' must be followed by a valid header name syntax. For example, #include <stdio.h misses the closing '>'.
E 30 include file "file" not found
Be sure you have specified an existing include file after a '#include' directive. Make sure you have specified the correct path for the file.
E 31 end-of-file encountered inside comment
The compiler found the end of a file while scanning a comment. Probably a comment was not terminated. Do not forget a closing comment '*/' when using ANSI-C style comments.
E 32 argument mismatch for macro "name"
The number of arguments in invocation of a function-like macro must agree with the number of parameters in the definition. Also, invocation of a function-like macro requires a terminating ")" token. The following are examples of this error:
#define A(a) 1
int i = A(1,2); /* error */
#define B(b) 1
int j = B(1; /* error */
E 33 "name" redefined
The given identifier was defined more than once, or a subsequent declaration differed from a previous one. The following examples generate this error:
int i;
char i; /* error */
main()
{
}
main()
{
int j;
int j; /* error */
}
W 34 illegal redefinition of macro "name"
A macro can be redefined only if the body of the redefined macro is exactly the same as the body of the originally defined macro.
This warning can be caused by defining a macro on the command line and in the source with a '#define' directive. It also can be caused
by macros imported from include files. To eliminate the warning, either remove one of the definitions or use an '#undef' directive before
the second definition.
E 35 bad filename in '#line'
The string literal of a #line (if present) may not be a "wide-char"
string. So, #line 9999 L"t45.c" is not allowed.
W 36 'debug' facility not installed
'#pragma debug' is only allowed in the debug version of the compiler.
W 37 attempt to divide by zero
A divide or modulo by zero was found. Adjust the expression or test
if the second operand of a divide or modulo is zero.
E 38 +non integral switch expression
A switch condition
expression must evaluate to an integral value. So, char *p = 0; switch (p) is not allowed.
F 39 unknown error number: number
This error may not occur. If it does, contact your local TASKING office and provide them with the exact error message.
W 40 non-standard escape sequence
Check the spelling of your escape sequence (a backslash, \,
followed by a number or letter), it contains an illegal escape character. For example, \c
causes this warning.
E 41 '#elif' without '#if'
The '#elif' directive did not appear within an '#if', '#ifdef or '#ifndef' construct. Make sure that there is a corresponding '#if', '#ifdef'
or '#ifndef' statement in effect before this statement.
E 42 syntax error, expecting parameter type/declaration/statement
A syntax error occurred in a parameter list a declaration or a statement. This can have many causes, such as, errors in syntax of numbers, usage of reserved words, operator errors, missing parameter types, missing tokens.
E 43 unrecoverable syntax error, skipping to end of file
The compiler found an error from which it could not recover. This error is in most cases preceded by another error. Usually, error E
42.
I 44 in initializer "name"
Informational message when checking for a proper constant initializer.
E 46 cannot hold that many operands
The value stack may not exceed 20 operands.
E 47 missing operator
An operator was expected in the expression.
E 48 missing right parenthesis
W 49 attempt to divide by zero - potential run-time error
An expression with a divide or modulo by zero was found. Adjust the expression or test if the second operand of a divide or modulo is
zero.
E 50 missing left parenthesis
E 51 cannot hold that many operators
The state stack may not exceed 20 operators.
E 52 missing operand
E 53 missing identifier after 'defined' operator
An identifier is required in a #if defined(identifier).
E 54 +non scalar controlling expression
Iteration conditions and 'if' conditions must have a scalar type (not
a struct, union or a pointer). For example, after
static struct {int i;} si = {0}; it is not allowed to specify
while (si) ++si.i;.
E 55 operand has not integer type
The operand of a '#if' directive must evaluate to an integral constant. So, #if 1.
is not allowed.
W 56 '<debugoption><level>' no associated
action
This warning can only appear in the debug version of the compiler. There is no associated debug action with the specified debug option and level.
W 58 invalid warning number: number
The warning number you supplied to the -w option does
not exist. Replace it with the correct number.
F 59 sorry, more than number errors
Compilation stops if there are more than 40 errors.
E 60 label "label" multiple defined
A label can be defined only once in the same function. The following is an example of this error:
f()
{
lab1:
lab1: /* error */
}
E 61 type clash
The compiler found conflicting types. For example, a
long is only allowed on int or double, no specifiers are allowed with struct, union or
enum. The
following is an example of this error:
unsigned signed int i; /* error */
E 62 bad storage class for "name"
The storage class specifiers auto and register may not appear in declaration specifiers of external definitions. Also, the only storage
class specifier allowed in a parameter declaration is
register.
E 63 "name" redeclared
The specified identifier was already declared. The compiler uses the second declaration. The following is an example of this error:
struct T { int i; };
struct T { long j; }; /* error */
E 64 incompatible redeclaration of "name"
The specified identifier was already declared. All declarations in
the same function or module that refer to the same object or function
must specify compatible types. The following is an example of this error:
f()
{
int i;
char i; /* error */
}
W 66 function "name": variable "name"
not used
A variable is declared which is never used. You can remove this unused variable or you can use the -w66 option to
suppress this warning.
W 67 illegal suboption: option
The suboption is not valid for this option. Check the invocation syntax for a list of all available suboptions.
W 68 function "name": parameter "name"
not used
A function parameter is declared which is never used. You can remove this unused parameter or you can use the -w68 option
to suppress this warning.
E 69 declaration contains more than one basic type specifier
Type specifiers may not be repeated. The following is an example of this error:
int char i; /* error */
E 70 +'break' outside loop or switch
A break statement
may only appear in a switch or a loop (do, for or while).
So, if (0) break; is not allowed.
E 71 illegal type specified
The type you specified is not allowed in this context. For example,
you cannot use the type void to declare a variable. The following is an example of this error:
void i; /* error */
W 72 duplicate type modifier
Type qualifiers may not be repeated in a specifier list or qualifier
list. The following is an example of this warning:
{ long long i; } /* error */
E 73 object cannot be bound to multiple memories
Use only one memory attribute per object. For example, specifying both rom and ram to the same object is not allowed.
E 74 declaration contains more than one class specifier
A declaration may contain at most one storage class specifier. So, register auto i; is not allowed.
E 75 +'continue' outside a loop
continue may
only appear in a loop body (do, for or while). So, switch (i) {default: continue;} is not allowed.
E 76 duplicate macro parameter "name"
The given identifier was used more than one in the formatl parameter list of a macro definition. Each macro parameter must be uniquely declared.
E 77 parameter list should be empty
An identifier list, not part of a function definition, must be empty.
For example, int f ( i, j, k ); is not allowed on declaration level.
E 78 'void' should be the only parameter
Within a function protoype of a function that does not except any arguments, void may be the only parameter. So, int f(void, int); is not allowed.
E 79 +constant expression expected
A constant expression may not contain a comma. Also, the bit field width, an expression that defines an enum, array-bound constants and switch case
expressions must all be integral contstant expressions.
E 80 '#' operator shall be followed by macro parameter
The '#' operator must be followed by a macro argument.
E 81 '##' operator shall not occur at beginning or end of
a macro
The '##' (token concatenation) operator is used to paste together adjacent preprocessor tokens, so it cannot be used at the beginning
or end of a macro body.
W 86 escape character truncated to 8 bit value
The value of a hexadicimal escape sequence (a backslash, \,
followed by a 'x' and a number) must fit in 8 bits storage. The number of bits per character may not be greater than 8. The following is an example of this warning:
char c = '\xabc'; /* error */
E 87 concatenated string too long
The resulting string was longer than the limit of 1500 characters.
W 88 "name" redeclared with different linkage
The specified identifier was already declared. This warning is issued when you try to redeclare an object with a different basic storage
class, and both objects are not declared extern or static. The following
is an example of this warning:
int i;
int i(); /* error E 64 and warning */
E 89 illegal bitfield declarator
A bit field may only be declared as an integer, not as a pointer or
a function for example. So, struct {int *a:1;} s; is not allowed.
E 90 #error message
The message is the descriptive text supplied in a '#error'
preprocessor directive.
W 91 no prototype for function "name"
Each function should have a valid function prototype.
W 92 no prototype for indirect function call
Each function should have a valid function prototype.
I 94 hiding earlier one
Additional message which is preceded by error E 63. The second declaration will be used.
F 95 protection error: message
Something went wrong with the protection key initialization. The message could be: "Key is not present or printer is not correct.",
"Can't read key.", "Can't initialize key.", or "Can't set key-model".
E 96 syntax error in #define
#define id(
requires a right-parenthesis ')'.
E 97 "..." incompatible with old-style prototype
If one function has a parameter type list and another function, with
the same name, is an old-style declaration, the parameter list may not
have ellipsis. The following is an example of this error:
int f(int, ...);
int f(); /* error, old-style */
E 98 function type cannot be inherited from a typedef
A typedef
cannot be used for a function definition. The following is an example of this error:
typedef int INTFN();
INTFN f {return (0);} /* error */
F 99 conditional directives nested too deep
'#if', '#ifdef' or '#ifndef' directives may not be nested deeper than
50 levels.
E 100 +case or default label not inside switch
The case:
or default:
label may only appear inside a switch.
E 101 vacuous declaration
Something is missing in the declaration. The declaration could be empty or an incomplete statement was found. You must declare array declarators and struct, union, or enum members. The following are examples of this error:
int ; /* error */
static int a[2] = { }; /* error */
E 102 +duplicate case or default label
Switch case
values must be distinct after evaluation and there may be at most one default: label inside a switch.
E 103 may not subtract pointer from scalar
The only operands allowed on subtraction of pointers is pointer - pointer, or pointer - scalar. So, scalar - pointer is not allowed.
The following is an example of this error:
int i;
int *pi = &i;
ff(1 - pi); /* error */
E 104 left operand of operator has not struct/union
type
The first operand of a '.' or '->'
must have a struct or union type.
E 105 zero or negative array size - ignored
Array bound constants must be greater than zero. So,
char a[0]; is not allowed.
E 106 different constructors
Compatible function types with parameter type lists must agree in number of parameters and in use of ellipsis. Also, the corresponding parameters must have compatible types. This error is usually followed by informational message I 111. The following is an example of this error:
int f(int);
int f(int, int); /* error different
parameter list */
E 107 different array sizes
Corresponding array parameters of compatible function types must have the same size.This error is usually followed by informational message I 111. The following is an example of this error:
int f(int [][2]);
int f(int [][3]); /* error */
E 108 different types
Corresponding parameters must have compatible types and the type of each prototype parameter must be compatible with the widened definition parameter. This error is usually followed by informational message I 111. The following is an example of this error:
int f(int);
int f(long); /* error different type
in parameter list */
E 109 floating point constant out of valid range
A floating point constant must have a value that fits in the type
to which it was assigned. See section Data Types for the valid range of a floating point constant. The following is
an example of this error:
float d = 10E9999; /* error, too big */
E 110 function cannot return arrays or functions
A function may not have a return type that is of type array or function. A pointer to a function is allowed. The following are examples of
this error:
typedef int F(); F f(); /* error */
typedef int A[2]; A g(); /* error */
I 111 parameter list does not match earlier prototype
Check the parameter list or adjust the prototype. The number and type of parameters must match. This message is preceded by error E 106,
E 107 or E 108.
E 112 parameter declaration must include identifier
If the declarator is a prototype, the declaration of each parameter
must include an identifier. Also, an identifier declared as a
typedef name cannot be a parameter name. The following are examples of this error:
int f(int g, int) {return (g);} /* error */
typedef int int_type;
int h(int_type) {return (0);} /* error */
E 114 incomplete struct/union type
The struct
or union type
must be known before you can use it. The following is an example of this error:
extern struct unknown sa, sb;
sa = sb; /* 'unknown' does not have a
defined type */
The left side of an assignment (the lvalue) must be modifiable.
E 115 label "name" undefined
A goto statement
was found, but the specified label did not exist in the same function or module. The following is an example of this error:
f1() { a: ; } /* W 116 */
f2() { goto a; } /* error, label 'a:' is
not defined in f2() */
W 116 label "name" not referenced
The given label was defined but never referenced. The reference of
the label must be within the same function or module. The following is
an example of this warning:
f() { a: ; } /* 'a' is not referenced */
E 117 "name" undefined
The specified identifier was not defined. A variable's type must be specified in a declaration before it can be used. This error can also
be the result of a previous error. The following is an example of this error:
unknown i; /* error, 'unknown' undefined */
i = 1; /* as a result, 'i' is also
undefined */
W 118 constant expression out of valid range
A constant expression used in a case label may not be too large. Also when converting a floating point value to an integer, the floating
point constant may not be too large. This warning is usually preceded by error E 16 or E 109. The following is an example of this warning:
int i = 10E88; /* error and warning */
E 119 cannot take 'sizeof' bitfield or void type
The size of a bit field or void type is not known. So, the size of it cannot be taken.
E 120 cannot take 'sizeof' function
The size of a function is not known. So, the size of it cannot be
taken.
E 121 not a function declarator
This is not a valid function. This may be due to a previous error.
The following is an example of this error:
int f() return 0; /* missing '{ }' */
int g() { } /* error, 'g' is not a
formal parameter and
therefore, this is not a
valid function declaration */
E 122 unnamed formal parameter
The parameter must have a valid name.
W 123 function should return something
A return in
a non-void
function must have an expression.
E 124 array cannot hold functions
An array of functions is not allowed.
E 125 +function cannot return anything
A return with
an expression may not appear in a void function.
W 126 missing return (function "name")
A non-void
function with a non-empty function body must have a return statement.
E 129 cannot initialize "name"
Declarators in the declarator list may not contain initializations.
Also, an extern declaration
may have no initializer. The following are examples of this error:
{ extern int i = 0; } /* error */
int f( i ) int i=0; /* error */
W 130 operands of operator are pointers
to different types
Pointer operands of an operator or assignment ('='), must have the same type. For example, the following code generates this warning:
long *pl;
int *pi = 0;
pl = pi; /* warning */
E 131 bad operand type(s) of operator
The operator needs an operand of another type. The following is an example of this error:
int *pi;
pi += 1.; /* error, pointer on left; needs
integral value on right */
W 132 value of variable "name" is undefined
This warning occurs if a variable is used before it is defined. For example, the following code generates this warning:
int a,b;
a = b; /* warning, value of b unknown */
E 133 illegal struct/union member type
A function cannot be a member of a struct or union. Also, bit fields may only have type int or unsigned.
E 134 bitfield size out of range - set to 1
The bit field width may not be greater than the number of bits in
the type and may not be negative. The following example generates this error:
struct i { unsigned i : 999; }; /* error */
W 135 statement not reached
The specified statement will never be executed. This is for example
the case when statements are present after a return.
E 138 illegal function call
You cannot perform a function call on an object that is not a function. The following example generates this error:
int i, j;
j = i(); /* error, i is not a function */
E 139 operator cannot have aggregate
type
The type name in a (cast) must be a scalar (not a
struct,
union or a pointer) and also the operand of a (cast) must be a scalar. The following are examples of this error:
static union ui {int a;} ui ;
ui = (union ui)9; /* cannot cast to union */
ff( (int)ui ); /* cannot cast a union
to something else */
E 140 type cannot be applied to a register/bit/bitfield
object or builtin/inline function
For example, the '&' operator (address) cannot be used on registers and bit fields. So, func(&r6); and func(&bitf.a); are invalid.
E 141 operator requires modifiable lvalue
The operand of the '++', or '--' operator and the left operand of
an assignment or compound assignment (lvalue) must be modifiable. The following is an example of this error:
const int i = 1;
i = 3; /* error, const cannot be
modified */
E 143 too many initializers
There may be no more initializers than there are objects. The following is an example of this error:
static int a[1] = {1, 2}; /* error,
only one object can be initialized */
W 144 enumerator "name" value out of range
An enum constant
exceeded the limit for an int. The following is an example of this warning:
enum { A = INT_MAX, B }; /* warning,
B does not fit in an int anymore */
E 145 requires enclosing curly braces
A complex initializer needs enclosing curly braces. For example,
int a[] = 2; is not valid, but int a[] = {2}; is.
E 146 argument #number: memory spaces do not
match
With prototypes, the memory spaces of arguments must match.
W 147 argument #number: different
levels of indirection
With prototypes, the types of arguments must be assignment compatible. The following code generates this warning:
int i; void func(int,int);
func( 1, &i ); /* warning, argument 2 */
W 148 argument #number: struct/union type does
not match
With prototypes, both the prototyped function argument and the actual argument was a struct or union., but they have different tags. The tag types should match. The following is an example of this warning:
f(struct s); /* prototype */
main()
{
struct { int i; } t;
f( t ); /* t has other type than s */
}
E 149 object "name" has zero size
A struct or
union may
not have a member with an incomplete type. The following is an example of this error:
struct { struct unknown m; } s; /* error */
W 150 argument #number: pointers to different
types
With prototypes, the pointer types of arguments must be compatible. The following example generates this warning:
int f(int*);
long *l;
f(l); /* warning */
W 151 ignoring memory specifier
Memory specifiers for a struct, union or enum are ignored.
E 152 operands of operator are not pointing
to the same memory space
Be sure the operands point to the same memory space. This error occurs, for example, when you try to assign a pointer to a pointer
from a different memory space.
E 153 'sizeof' zero sized object
An implicit or explicit sizeof operation references an object with an unkown size. This error is usually preceded by error E 119 or E 120, cannot take 'sizeof'.
E 154 argument #number: struct/union mismatch
With prototypes, only one of the prototyped function argument or the actual argument was a struct or union. The types should match. The following is an example of this error:
f(struct s); /* prototype */
main()
{
int i;
f( i ); /* i is not a struct */
}
E 155 casting lvalue 'type' to 'type'
is not allowed
The operand of the '++', or '--' operator or the left operand of an assignment or compound assignment (lvalue) may not be cast to another type. The following is an example of this error:
int i = 3;
++(unsigned)i; /* error, cast expression
is not an lvalue */
E 157 "name" is not a formal parameter
If a declarator has an identifier list, only its identifiers may appear
in the declarator list. The following is an example of this error:
int f( i ) int a; /* error */
E 158 right side of operator is not a member
of the designated struct/union
The second operand of '.' or '->' must be a member
of the designated struct or
union.
E 160 pointer mismatch at operator
Both operands of operator must be a valid pointer.
The following example generates this error:
int *pi = 44; /* right side not a pointer */
E 161 aggregates around operator
do not match
The contents of the structs, unions or arrays on both sides of the operator must be the same. The following example causes
this error:
struct {int a; int b;} s;
struct {int c; int d; int e;} t;
s = t; /* error */
E 162 operator requires an lvalue or function
designator
The '&' (address) operator requires an lvalue or function designator. The following is an example of this error:
int i;
i = &( i = 0 );
W 163 operands of operator have different level
of indirection
The types of pointers or addresses of the operator must be assignment compatible. The following is an example of this warning:
char **a;
char *b;
a = b; /* warning */
E 164 operands of operator may not have type
'pointer to void'
The operands of operator may not have operand
(void *).
W 165 operands of operator are incompatible:
pointer vs. pointer to array
The types of pointers or addresses of the operator must be assignment compatible. A pointer cannot be assigned to a pointer to array. The following is an example of this warning:
main()
{
typedef int array[10];
array a;
array *ap = a; /* warning */
}
E 166 operator cannot make something out of
nothing
Casting type void to something else is not allowed. The following example generates this error:
void f(void);
main()
{
int i;
i = (int)f(); /* error */
}
E 170 recursive expansion of inline function "name"
An _inline
function may not be recursive. The following example generates this error:
_inline int a (int i)
{
a(i); /* recursive call */
return i;
}
main()
{
a(1); /* error */
}
E 171 +too much tail-recursion in inline function "name"
If the function level is greater than or equal to 40 this error is
given. The following example generates this error:
_inline void a ()
{
a();
}
main()
{
a();
}
W 172 adjacent strings have different types
When concatenating two strings, they must have the same type. The following example generates this warning:
char b[] = L"abc""def"; /* strings have
different types */
E 173 'void' function argument
A function may not have an argument with type void.
E 174 not an address constant
A constant address was expected. Unlike a static variable, an automatic variable does not have a fixed memory location and therefore, the address of an automatic is not a constant. The following is an example of this error:
int *a;
static int *b = a; /* error */
E 175 not an arithmetic constant
In a constant expression no assignment operators, no '++' operator,
no '--' operator and no functions are allowed. The following is an example of this error:
int a;
static int b = a++; /* error */
E 176 address of automatic is not a constant
Unlike a static variable, an automatic variable does not have a fixed memory location and therefore, the address of an automatic is not
a constant. The following is an example of this error:
int a; /* automatic */
static int *b = &a; /* error */
W 177 static variable "name" not used
A static variable is declared which is never used. To eliminate this warning remove the unused variable.
W 178 static function "name" not used
A static function is declared which is never called. To eliminate
this warning remove the unused function.
E 179 +inline function "name" is not defined
Possibly only the prototype of the inline function was present, but
the actual inline function was not. The following is an example of this error:
_inline int a(void); /* prototype */
main()
{
int b;
b = a(); /* error */
};
E 180 illegal target memory (memory) for pointer
The pointer may not point to memory. For example, a
pointer to bitaddressable memory is not allowed.
E 181 invalid cast to function
A cast to type function is not allowed. A cast to a function pointer
type is allowed.
W 182 argument #number: different types
With prototypes, the types of arguments must be compatible.
W 183 variable 'name' possibly uninitialized
Possibly an initialization statement is not reached, while a function should return something. The following is an example of this warning:
int a;
int f(void)
{
int i;
if ( a )
{
i = 0; /* statement not reached */
}
return i; /* warning */
}
W 184 empty pragma name in -z option - ignored
The -z option requires a pragma name.
I 185 (prototype synthesized at line number
in "name")
This is an informational message containing the source file position where an old-style prototype was synthesized. This message is preceded by error E 146, W 147, W 148, W 150, E 154, W 182 or E 203.
E 186 array of type bit is not allowed
An array cannot contain bit type variables.
E 187 illegal structure definition
A structure can only be defined (initialized) if its members are known. So, struct unknown s = { 0 }; is not allowed.
E 188 structure containing bit-type fields is forced into
bitaddressable area
This error occurs when you use a bitaddressable storage type for a structure containing bit-type members.
E 189 pointer is forced to bitaddressable, pointer to bitaddressable
is illegal
A pointer to bitaddressable memory is not allowed.
W 190 "long float" changed to "float"
In ANSI C floating point constants are treated having type
double, unless the constant has the suffix 'f'. If you have specified an option
to use float constants, a long floating point constant such as 123.12fl is changed to a float.
E 191 recursive struct/union definition
A struct or
union cannot
contain itself. The following example generates this error:
struct s { struct s a; } b; /* error */
E 192 missing filename after -f option
The -f option requires a filename argument.
E 194 cannot initialize typedef
You cannot assign a value to a typedef variable. So,
typedef i=2; is not allowed.
W 195 constant expression out of range -- truncated
The resulting constant expression is too large to fit in the specified
data type. The value is truncated. The following example generates this warning:
int i = 140000L; /* warning, value is too large
to fit in an int */
W 196 constant expression out of range due to signed/unsigned
type mismatch
The resulting constant expression is too large to fit in the specified
data type. The following example generates this warning:
int i = 40000U; /* the unsigned value is too large
to fit in a signed int */
/* unsigned int i = 40000U; is OK */
W 197 unrecognized -w argument: argument
The -w option only accepts a warning number or the
text 'strict' as an argument. See the description of the -w option for details.
W 198 trigraph sequence replaced
Trigraphs are used in the C language to create special characters
on obsolete terminals with a limited character set. When they are replaced in your source, e.g. in a string, they may give rise to very obscure errors.
F 199 demonstration package limits exceeded
The demonstration package has certain limits which are not present
in the full version. Contact TASKING for a full version.
W 200 unknown pragma - ignored
The compiler ignores pragmas that are not known. For example, #pragma unknown.
W 201 name cannot have storage type - ignored
A register
variable or an automatic/parameter cannot have a storage type. To eliminate this warning, remove the storage type or place
the variable outside a function.
E 202 'name' is declared with 'void' parameter
list
You cannot call a function with an argument when the function does not accept any (void parameter list). The following is an example of this error:
int f(void); /* void parameter list */
main()
{
int i;
i = f(i); /* error */
i = f(); /* OK */
}
E 203 too many/few actual parameters
With prototyping, the number of arguments of a function must agree with the protoype of the function. The following is an example of
this error:
int f(int); /* one parameter */
main()
{
int i;
i = f(i,i); /* error, one too many */
i = f(i); /* OK */
}
W 204 U suffix not allowed on floating constant - ignored
A floating point constant cannot have a 'U' or 'u' suffix.
W 205 F suffix not allowed on integer constant - ignored
An integer constant cannot have a 'F' or 'f' suffix.
E 206 'name' named bit-field cannot have 0
width
A bit field must be an integral contstant expression with a value
greater than zero.
E 207 list of rule numbers expected after "-misrac" option
Add the numbers of the MISRA C rules to the -misrac option to specifiy the rules that must be checked. See Appendix B
MISRA C
W 208 unsupported MISRA C rule number number.
Specified MISRA C rule number is not supported.
E 209 +MISRA C rule number violation: rule_description
A specified MISRA C rule is violated.
E 212 "name": missing static function
definition
A function with a static prototype misses its definition.
W 213 invalid string/character constant in non-active part
of source
This part of the source is skipped.
E 214 second occurrence of #pragma asm or asm_noflush
#pragma asm/#pragma endasm blocks cannot be nested. Use #pragma endasm before starting a new #pragma asm/#pragma endasm block.
E 215 "#pragma endasm" without a "#pragma asm"
A #pragma endasm must always have a corresponding
#pragma asm or #pragma asm_noflush.
W 216 suggest parentheses around assignment used as truth
value
Generated when the argument of an if statement is actually an assignment (might indicate a typing error).
W 303 variable 'name' uninitialized
Possibly an initialization statement is not reached, while a function should return something. The following is an example of this warning:
int a;
int f(void)
{
int i;
if ( a )
{
i = 0; /* statement not reached */
}
return i; /* warning */
}
E 327 too many arguments to pass in registers for _asmfunc
'name'
An _asmfunc
function uses a fixed register-based interface between C and assembly, but the number of arguments that can be passed is limited by the number of available registers. With function name this limit was reached.
Backend
W 501 initializer was truncated
When a value does not fit in a character, structure or integer, the
value is truncated.
E 502 fail to generate code for type
The compiler could not generate code for this type.
F 504 object doesn't fit in memory: memory
The object is too large for the specified memory type.
E 519 no indirection allowed on bit type
Bitaddressable memory is only direct addressable. Pointer to
_bit and array of _bit are not allowed.
E 521 out of temporary bit storage, simplify expression
The expression used too many static bit temporaries.
E 527 move to read-only field
Of course you can only read from a read-only field.
E 531 restriction: impossible to convert to 'type'
A structure or union cannot be converted to type
bit,
char,
float, int or
long.
E 539 operator not allowed on type
type
Some operators are not allowed on type _bit.
E 540 "function" is not a 'plmprocedure'
You cannot write plmprocedures within 'C', only a call is possible.
E 541 not allowed to switch on pointer type
A pointer type is not allowed as switch expression.
E 542 switch only possible on char/int/long type
A _bit typed
expression is not allowed as switch expression.
E 543 static model: non-register parameters not allowed with
function pointer
Static passing does not allow parameters with function pointers.
E 544 illegal testclear argument
See the description of the intrinsic function testclear for the correct syntax.
W 545 no address available for variable argument list
There is no address reference available for va_start.
E 547 calling an interrupt routine is not allowed
It is never allowed to call an interrupt function.
E 550 assignment/parameter/return not allowed with bit-structure
A _bit structure can only contain members of type
_bit.
F 551 illegal registerbank number
The register bank number must be a number in the range 0 to 3.
F 552 illegal rom model
Only the rom models 's', 'm' and 'l' are allowed.
F 553 illegal memory model
Only the memory models 's', 'a', 'l' and 'r' are allowed.
F 554 illegal memory type specified
See the description of the -R option or the -m option for the correct syntax.
F 555 illegal memory size given
The argument of the -m option can only contain numerical
values
W 556 _plmprocedure is in conflict with _regparm
_regparm and
_plmprocedure cannot be used together.
W 558 static model (overlaying) disables -rm (rom
medium) -ignored
The -rm option is useless in the static model because
each function has its own code segment.
E 559 impossible to save structure result, simplify expression
The structure or union could not be saved on stack.
W 560 reentrant interrupt function ("name")
with local variables: adjust library
Use the protected version of the library.
W 561 interrupt function calling a reentrant function:
adjust library
A reentrant function cannot be called from an interrupt function.
E 562 bit-type parameter/automatic only allowed in static
models
_bit parameters/automatics are not allowed in _reentrant functions.
W 563 automatic cannot have storage type rom - ignored
It is not possible to store automatic variables in rom. The rom type
is removed.
E 564 'name' is illegal memory for function
A function can have return type _bit or program code. A function cannot have return type _bitbyte.
W 565 conversion of long address to short address
The conversion of xdat to pdat pointer is allowed: same physical space.
F 566 illegal number in option option
The argument of the -a, -b, -c and -x option can only contain numerical values.
E 570 Cannot take address of bit-variable or bit-structure
You cannot take the address of a bit-variable or bit-structure.
W 575 'reg'-field (CSE-administration : number)
not empty
The CSE administation is cleaned up and compilation continues.
E 576 _at() expects a constant address
You can only use an expression that evaluates to a numerical address.
E 577 _at() address out of range for this type of object
The absolute address is not present in the specified memory space.
E 578 _at() only valid for global variables
Only global variables can be placed on absolute addresses.
E 579 'bitoffset' for 'name' must be a constant
value between 0 and number
The bitoffset wihin a bitbyte must be a constant value between 0 and (size_of_bitbyte * 8) - 1.
E 580 specified object not bitaddressable
_bitbyte can
only be used on bitaddressable memory. Also, the SFR must be bitaddressable.
E 581 different register bank ('using')
The register bank numbers of the calling and called function must
be the same.
E 583 _at() only allowed on non initialized variables
Absolute variables cannot be initialized.
W 585 duplicate function qualifier - 'interrupt(number)/ using(number)/ plmprocedure()' ignored
Only one function qualifier is allowed.
W 586 R2/R3 contained a CSE, which could have been used once
more
The CSE in the R2 or R3 register can be used once more.
W 587 'number' illegal name
number (0 to max) - ignored
An _interrupt number must be a number between 0 and 16. An _using number
must be a number between 0 and 3.
E 589 interrupt function must have void result and void parameter
list
A function declared with _interrupt(n) is not allowed to have any arguments and must not return anything.
E 591 conflict in 'interrupt' attribute
The attributes of the current function qualifier declaration and the previous function qualifier declaration are not the same.
E 592 different 'interrupt/using/plmprocedure' number
The interrupt/using/plmprocedure number of the current function qualifier declaration and the previous function qualifier declaration
are not the same.
W 593 function qualifier used with non-function
A function qualifier can only be used on functions.
W 594 duplicate or conflicting function qualifier - 'name' ignored
Only one function qualifier is allowed.
W 595 _at() has no effect on external declaration
When declared extern the variable is not allocated by the compiler.
E 596 function models (_small/_aux/_large/_reentrant) do not
match
The function and the prototype of the function must have the same model qualifier.
E 597 parameter passing attributes (_regparm/_cdecl) do not
match
The function and the prototype of the function must have the same parameter passing attributes.
E 598 _atbit() only possible on objects, not on constant addresses
_atbit() is
not possible on constant addresses, they are only possible on _bitbyte
or _sfrbyte
objects.
E 599 _atbit() only possible on _bitbyte/_sfrbyte objects
_atbit() only
accepts _bitbyte or _sfrbyte objects as an argument.
E 600 _atbit() only possible for _bit/_sfrbit objects
Only _bit
and _sfrbit
objects can be declared with _atbit().
E 601 _atbit() object must have same storage as target object
The storage class of both _atbit() objects must be the same.
E 602 _sfrbit object can only have _atbit() on an _sfrbyte
object
_bit object can only have _atbit() on a _bitbyte object
You cannot specify a _sfrbit object with _atbit() on a _bitbyte object, and you cannot specify a _bit object with _atbit() on a _sfrbyte object.
E 603 in space _bdat only integral objects are allowed
Space _bdat
is bitaddressable ram. In this space you can only use integral objects.
E 604 illegal interrupt option, specify -ivo=<value>
Only the -ivo option is allowed. Check the syntax
of your -ivo option.
E 605 illegal interrupt vector option, specify -v or -vf
Only the -v or -vf option are allowed.
Check the syntax of your -v option.
E 606 unknown register name: "name"
You specified a non-existing register name to pragma
intsave. Correct the name.
E 607 register name expected
Pragma intsave requires a register name.
E 608 '_frame()' without '_interrupt()'
The _frame
function qualifier can only be used on _interrupt functions.
E 609 different _frame() lists
The list of registers/SFRs of the current _frame function qualifier declaration and the previous _frame function qualifier declaration are not the same.
E 611 code generation attribute _noregaddr does not match
The attribute _noregaddr does not match with the prototype of the function.
E 612 _inline useless on interrupt function
Interrupt functions cannot be defined as _inline functions.
E 613 _sfrbit/byte only allowed for global variables
Only global variables can be placed on absolute addresses.
F 614 code generation stopped
The compiler found an unresolvable error and cannot continue.
E 617 _atbit() not possible on type: "name"
You cannot use: struct / union members, tags, labels, parameters or inline function locals as a base symbol to define bits in.
W 619 interrupt uses default register bank
The interrupt function was specified to use the default register bank (usually register bank 0). For example the following may result in
a run-time error if 0 is the default register bank:
void _interrupt(1) _using(0) ISR(void);
Choose another register bank for the interrupt function.
E 622 interrupt number number already
used
Each interrupt function must use a unique interrupt number.
Copyright © 2002 Altium BV