Warnings

Warnings produce information about potential problems which may occur during the execution of the resulting program. Warnings do not hinder compilation of the source file.

Warnings produce a message in the list file. These warning messages are in the following format:

*** WARNING number IN LINE line OF file: warning message
where:

number    is the error number.

line    corresponds to the line number in the source file or include file.

file    is the name of the source or include file in which the error was detected.

warning message    is descriptive text that is dependent on the type of warning encountered.

The following table lists warnings by number. The warning message displayed is listed along with a brief description and possible cause and correction.

Number

Message and Description

173

missing return-expression

A function which returns a value of any type but int, must contain a return statement including an expression. Because of compatibility to older programs, no check is done on functions which return an int value

182

pointer to different objects
A pointer was assigned the address of a different type.

185

different memory space
The memory space of an object declaration differs from the memory space of a prior declaration for the same object.

196

mspace probably invalid
This warning is caused by the assignment of an invalid constant value to a pointer.

Valid pointer constants are long or unsigned long. The compiler uses 24 bits ( 3 bytes ) for pointer objects. The low-order 16 bits represent the offset. The high-order 8 bits represent the memory space selector. The selector must be a number in the 1 to 5 range to select idata, xdata, pdata, data, or code, respectively.

198

sizeof returns zero
The calculation of the size of an object yields zero. This value may be wrong if the object is external or if not all dimension sizes of an array are known.

206

missing function prototype
The called function is unknown because no prototype declaration exists. The message should be understood as a warning.

Calls to unknown functions are always at risk that the number of parameters does not correspond to the actual requirements. If this is the case, the function is called incorrectly.

The compiler has no way to check for missing or excessive parameters and their types. Include prototypes of the functions used in your program. Prototypes must be specified before the functions are actually called. The definition of a function automatically produces a prototype.

209

too few actual parameters

Too few actual parameters were included in a function call.

219

long constant truncated to int

The value of a constant expression must be capable of being represented by an int type.

245

unknown progma, line ignored

The #progma statement is unknown, so the entire progma line is ignored.

258

mspace illegal on struct.union member
mspace on parameter ignored

A member of a structure or a parameter may not contain the specification of a memory type. The object to which the pointer refers may, however, contain a memory type. For Example:

  struct vp { char c; int xdata i; };

generates error 258

  struct v1 { char c; int xdata *I; };

is the correct declaration for the struct.

259

pointer: different mspace
This warning is generated when two pointers that do not refer to the same memory type of object are compared.

260

pointer truncation
This error or warning occurs when converting a pointer to a pointer with a smaller offset area. The conversion takes place, but the offset of the larger pointer is truncated to fit into the smaller pointer.

261

bit in reentrant function
A reentrant function cannot contain bits because bit scalars cannot be stored on the virtual stack.

265

'name': recursive call to nonreentrant function
A direct recursion to a non-reentrant function was discovered. This can be intentional but should be functionally checked (through the generated code) for each individual case. Indirect recursion is discovered by L51.

271

misplaced 'asm/endasm' control
The asm and endasm statements may not be nested. Endasm requires that an asm block was opened by a previous asm statement. For example:

#pragma asm
..
assembler instruction(s)
..
#pragma endasm

275

expression with possibly no effect

The compiler detected an expression which does not generate code. For example:

Void test (void) {

  int i1, i2, I3;

  i1, i2, i3; /* dead expression */

  I1 << 3 /* result is not used */

}

276

constant in condition expression
The compiler detected a conditional expression with a constant value. In most cases this is a typing mistake. For Example:

Void test (void) {

  int i1, i2, I3;

  if (i1=1) i2=3; /* const assigned with = */

  while (i3 = 2); /* const assigned with = */

}

277

different mspaces to pointer

A typedef declaration has a conflict of the memory spaces.

280

unreferenced symbol.label

This message identifies a symbol or label which has been defined but not used.

307

macro 'name': parameter count mismatch
The number of actual parameters in a macro call does not match the number of parameters of the macro definition. This warning indicates that too many parameters were used. Excess parameters are ignored.

317

macro ‘name’: invalid redefinition
A predefined macro cannot be redefined or removed. The compiler recognizes the following predefined macros:

_ _C51_ _ _ _DATE_ _    _ _FILE_ _
_ _TIME_ _ _ _LINE_ _
    _ _STDC_ _
_ _MODEL_ _

322

unknown identifier

The identifier in an #if directive line is undefined (evaluates to FALSE)

323

newline expected, extra characters found

A #directive line is correct but contains extra non commented characters. For Example:

  #include <stdio.h> foo

324

preprocessor token expected

A preprocessor token was expected but a newline character was found in input. For Example: #line where the arguments to the #line directive are missing