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:

The output file, bug.src, contains:

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:

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:

In a bourne shell script, the exit status can be found in the $? variable, for example:

The exit status of cc51 is one of the numbers of the following list:

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:

Frontend

F 1 evaluation expired

W 2 unrecognized option: 'option'

E 4 expected number more '#endif'

E 5 no source modules

F 6 cannot create "file"

F 7 cannot open "file"

F 8 attempt to overwrite input file "file"

E 9 unterminated constant character or string

F 11 file stack overflow

F 12 memory allocation error

W 13 prototype after forward call or old style declaration - ignored

E 14 ';' inserted

E 15 missing filename after -o option

E 16 bad numerical constant

E 17 string too long

E 18 illegal character (0xhexnumber)

E 19 newline character in constant

E 20 empty character constant

E 21 character constant overflow

E 22 '#define' without valid identifier

E 23 '#else' without '#if'

E 24 '#endif' without matching '#if'

E 25 missing or zero line number

E 26 undefined control

W 27 unexpected text after control

W 28 empty program

E 29 bad '#include' syntax

E 30 include file "file" not found

E 31 end-of-file encountered inside comment

E 32 argument mismatch for macro "name"

E 33 "name" redefined

W 34 illegal redefinition of macro "name"

E 35 bad filename in '#line'

W 36 'debug' facility not installed

W 37 attempt to divide by zero

E 38 +non integral switch expression

F 39 unknown error number: number

W 40 non-standard escape sequence

E 41 '#elif' without '#if'

E 42 syntax error, expecting parameter type/declaration/statement

E 43 unrecoverable syntax error, skipping to end of file

I 44 in initializer "name"

E 46 cannot hold that many operands

E 47 missing operator

E 48 missing right parenthesis

W 49 attempt to divide by zero - potential run-time error

E 50 missing left parenthesis

E 51 cannot hold that many operators

E 52 missing operand

E 53 missing identifier after 'defined' operator

E 54 +non scalar controlling expression

E 55 operand has not integer type

W 56 '<debugoption><level>' no associated action

W 58 invalid warning number: number

F 59 sorry, more than number errors

E 60 label "label" multiple defined

E 61 type clash

E 62 bad storage class for "name"

E 63 "name" redeclared

E 64 incompatible redeclaration of "name"

W 66 function "name": variable "name" not used

W 67 illegal suboption: option

W 68 function "name": parameter "name" not used

E 69 declaration contains more than one basic type specifier

E 70 +'break' outside loop or switch

E 71 illegal type specified

W 72 duplicate type modifier

E 73 object cannot be bound to multiple memories

E 74 declaration contains more than one class specifier

E 75 +'continue' outside a loop

E 76 duplicate macro parameter "name"

E 77 parameter list should be empty

E 78 'void' should be the only parameter

E 79 +constant expression expected

E 80 '#' operator shall be followed by macro parameter

E 81 '##' operator shall not occur at beginning or end of a macro

W 86 escape character truncated to 8 bit value

E 87 concatenated string too long

W 88 "name" redeclared with different linkage

E 89 illegal bitfield declarator

E 90 #error message

W 91 no prototype for function "name"

W 92 no prototype for indirect function call

I 94 hiding earlier one

F 95 protection error: message

E 96 syntax error in #define

E 97 "..." incompatible with old-style prototype

E 98 function type cannot be inherited from a typedef

F 99 conditional directives nested too deep

E 100 +case or default label not inside switch

E 101 vacuous declaration

E 102 +duplicate case or default label

E 103 may not subtract pointer from scalar

E 104 left operand of operator has not struct/union type

E 105 zero or negative array size - ignored

E 106 different constructors

E 107 different array sizes

E 108 different types

E 109 floating point constant out of valid range

E 110 function cannot return arrays or functions

I 111 parameter list does not match earlier prototype

E 112 parameter declaration must include identifier

E 114 incomplete struct/union type

E 115 label "name" undefined

W 116 label "name" not referenced

E 117 "name" undefined

W 118 constant expression out of valid range

E 119 cannot take 'sizeof' bitfield or void type

E 120 cannot take 'sizeof' function

E 121 not a function declarator

E 122 unnamed formal parameter

W 123 function should return something

E 124 array cannot hold functions

E 125 +function cannot return anything

W 126 missing return (function "name")

E 129 cannot initialize "name"

W 130 operands of operator are pointers to different types

E 131 bad operand type(s) of operator

W 132 value of variable "name" is undefined

E 133 illegal struct/union member type

E 134 bitfield size out of range - set to 1

W 135 statement not reached

E 138 illegal function call

E 139 operator cannot have aggregate type

E 140 type cannot be applied to a register/bit/bitfield object or builtin/inline function

E 141 operator requires modifiable lvalue

E 143 too many initializers

W 144 enumerator "name" value out of range

E 145 requires enclosing curly braces

E 146 argument #number: memory spaces do not match

W 147 argument #number: different levels of indirection

W 148 argument #number: struct/union type does not match

E 149 object "name" has zero size

W 150 argument #number: pointers to different types

W 151 ignoring memory specifier

E 152 operands of operator are not pointing to the same memory space

E 153 'sizeof' zero sized object

E 154 argument #number: struct/union mismatch

E 155 casting lvalue 'type' to 'type' is not allowed

E 157 "name" is not a formal parameter

E 158 right side of operator is not a member of the designated struct/union

E 160 pointer mismatch at operator

E 161 aggregates around operator do not match

E 162 operator requires an lvalue or function designator

W 163 operands of operator have different level of indirection

E 164 operands of operator may not have type 'pointer to void'

W 165 operands of operator are incompatible: pointer vs. pointer to array

E 166 operator cannot make something out of nothing

E 170 recursive expansion of inline function "name"

E 171 +too much tail-recursion in inline function "name"

W 172 adjacent strings have different types

E 173 'void' function argument

E 174 not an address constant

E 175 not an arithmetic constant

E 176 address of automatic is not a constant

W 177 static variable "name" not used

W 178 static function "name" not used

E 179 +inline function "name" is not defined

E 180 illegal target memory (memory) for pointer

E 181 invalid cast to function

W 182 argument #number: different types

W 183 variable 'name' possibly uninitialized

W 184 empty pragma name in -z option - ignored

I 185 (prototype synthesized at line number in "name")

E 186 array of type bit is not allowed

E 187 illegal structure definition

E 188 structure containing bit-type fields is forced into bitaddressable area

E 189 pointer is forced to bitaddressable, pointer to bitaddressable is illegal

W 190 "long float" changed to "float"

E 191 recursive struct/union definition

E 192 missing filename after -f option

E 194 cannot initialize typedef

W 195 constant expression out of range -- truncated

W 196 constant expression out of range due to signed/unsigned type mismatch

W 197 unrecognized -w argument: argument

W 198 trigraph sequence replaced

F 199 demonstration package limits exceeded

W 200 unknown pragma - ignored

W 201 name cannot have storage type - ignored

E 202 'name' is declared with 'void' parameter list

E 203 too many/few actual parameters

W 204 U suffix not allowed on floating constant - ignored

W 205 F suffix not allowed on integer constant - ignored

E 206 'name' named bit-field cannot have 0 width

E 207 list of rule numbers expected after "-misrac" option

W 208 unsupported MISRA C rule number number.

E 209 +MISRA C rule number violation: rule_description

E 212 "name": missing static function definition

W 213 invalid string/character constant in non-active part of source

E 214 second occurrence of #pragma asm or asm_noflush

E 215 "#pragma endasm" without a "#pragma asm"

W 216 suggest parentheses around assignment used as truth value

W 303 variable 'name' uninitialized

E 327 too many arguments to pass in registers for _asmfunc 'name'

Backend

W 501 initializer was truncated

E 502 fail to generate code for type

F 504 object doesn't fit in memory: memory

E 519 no indirection allowed on bit type

E 521 out of temporary bit storage, simplify expression

E 527 move to read-only field

E 531 restriction: impossible to convert to 'type'

E 539 operator not allowed on type type

E 540 "function" is not a 'plmprocedure'

E 541 not allowed to switch on pointer type

E 542 switch only possible on char/int/long type

E 543 static model: non-register parameters not allowed with function pointer

E 544 illegal testclear argument

W 545 no address available for variable argument list

E 547 calling an interrupt routine is not allowed

E 550 assignment/parameter/return not allowed with bit-structure

F 551 illegal registerbank number

F 552 illegal rom model

F 553 illegal memory model

F 554 illegal memory type specified

F 555 illegal memory size given

W 556 _plmprocedure is in conflict with _regparm

W 558 static model (overlaying) disables -rm (rom medium) -ignored

E 559 impossible to save structure result, simplify expression

W 560 reentrant interrupt function ("name") with local variables: adjust library

W 561 interrupt function calling a reentrant function: adjust library

E 562 bit-type parameter/automatic only allowed in static models

W 563 automatic cannot have storage type rom - ignored

E 564 'name' is illegal memory for function

W 565 conversion of long address to short address

F 566 illegal number in option option

E 570 Cannot take address of bit-variable or bit-structure

W 575 'reg'-field (CSE-administration : number) not empty

E 576 _at() expects a constant address

E 577 _at() address out of range for this type of object

E 578 _at() only valid for global variables

E 579 'bitoffset' for 'name' must be a constant value between 0 and number

E 580 specified object not bitaddressable

E 581 different register bank ('using')

E 583 _at() only allowed on non initialized variables

W 585 duplicate function qualifier - 'interrupt(number)/ using(number)/ plmprocedure()' ignored

W 586 R2/R3 contained a CSE, which could have been used once more

W 587 'number' illegal name number (0 to max) - ignored

E 589 interrupt function must have void result and void parameter list

E 591 conflict in 'interrupt' attribute

E 592 different 'interrupt/using/plmprocedure' number

W 593 function qualifier used with non-function

W 594 duplicate or conflicting function qualifier - 'name' ignored

W 595 _at() has no effect on external declaration

E 596 function models (_small/_aux/_large/_reentrant) do not match

E 597 parameter passing attributes (_regparm/_cdecl) do not match

E 598 _atbit() only possible on objects, not on constant addresses

E 599 _atbit() only possible on _bitbyte/_sfrbyte objects

E 600 _atbit() only possible for _bit/_sfrbit objects

E 601 _atbit() object must have same storage as target object

E 602 _sfrbit object can only have _atbit() on an _sfrbyte object
_bit object can only have _atbit() on a _bitbyte object

E 603 in space _bdat only integral objects are allowed

E 604 illegal interrupt option, specify -ivo=<value>

E 605 illegal interrupt vector option, specify -v or -vf

E 606 unknown register name: "name"

E 607 register name expected

E 608 '_frame()' without '_interrupt()'

E 609 different _frame() lists

E 611 code generation attribute _noregaddr does not match

E 612 _inline useless on interrupt function

E 613 _sfrbit/byte only allowed for global variables

F 614 code generation stopped

E 617 _atbit() not possible on type: "name"

W 619 interrupt uses default register bank

     void _interrupt(1) _using(0) ISR(void);

E 622 interrupt number number already used


Copyright © 2002 Altium BV