5 COMPILER DIAGNOSTICS

This chapter contains the following sections:

Introduction
Return Values
Errors and Warnings

5.1 Introduction

ctri 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.

If you program a non fatal error, ctri 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. However, in this case, ctri displays the line number causing the error before the error message. ctri always generates the error number in the assembly output file, exactly matching the place where the error occurred.

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 into an erroneous assembly output file. They are meant to draw your attention to assumptions of the compiler, for a situation which may not be correct. Warning messages can be controlled 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

ctri returns an exit status to the operating system environment for testing.

For example,

in a 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 ctri 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 "name" - 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

W 208 unsupported MISRA C rule number %d.

E 209 +MISRA C rule %d violation: %s

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 303 variable 'name' uninitialized

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

Backend

W 501 function qualifier used on non-function

W 502 _fract constant saturation occurred

E 503 conversion between _fract types and integer not allowed

E 504 initialization with constant not allowed for circular pointers

E 505 no conversions allowed to/from packed types

E 506 _sat _packb add/subtract is not supported by the TriCore instruction set

W 508 duplicate function qualifier

E 509 function definition not allowed for _syscallfunc() function "name"

E 510 pointer to _syscallfunc() function "name" not allowed

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

W 512 illegal interrupt number 'number' - ignored

E 513 calling an interrupt routine

E 514 conflict in '_interrupt/_stackparm' attribute

E 515 different '_interrupt' number

E 516 'memory_type' is illegal memory for function

E 517 _packb/_packhw division is not supported

E 526 Identifier name unknown

W 527 _sat ignored for 'operation' operator on type _accum

E 528 _at() requires a numerical address

E 530 _at()/_atbit() only valid for global variables

E 531 _at()/_atbit() only allowed for uninitialized variables

E 532 _atbit() only valid for '_at' variables

W 533 language extension keyword used as identifier

W 534 #pragma section: duplicate section suffix ignored

E 535 #pragma section: unknown section type

E 536 #pragma section: '=' expected

E 537 #pragma section: section name expected

E 538 #pragma section: syntax error

W 540 #pragma stack underflow

W 541 pragma name should be followed by on/off/restore, a number or nothing

W 542 #pragma optimize: stack underflow

W 543 #pragma switch: stack underflow

W 544 #pragma switch must be followed by one of: auto, linear, jumptab, lookup, restore

E 547 assignment of a (non-)circular object to a (non-)circular pointer

E 549 only _circ pointers and arrays/structs/unions are allowed - ignored on struct/union member 'name'

F 550 file write error

F 552 pointer to variable of type -bit is not allowed

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

E 558 bit position must be a constant value in the range [0..32)

E 560 builtin function "name" requires constant argument

W 561 "enum" bitfield type treated as "int"

E 562 #pragma asm: cannot use register name

E 563 #pragma asm: scratch register index must be less than 10

E 564 #pragma asm: register name mentioned multiple times

E 565 #pragma asm: syntax error

E 566 #pragma endasm: register name must be declared in #pragma asm

E 567 #pragma endasm: type of register name does not agree with #pragma asm

E 568 #pragma endasm: cannot assign register name to multiple variables

E 569 #pragma endasm: syntax error

E 570 #pragma asm: unknown scratch register name


Copyright © 2002 Altium BV