Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual
Product codes
SW006021-1
MPLAB
®
XC8 C Compiler User’s Guide
DS52053B-page 406
2012 Microchip Technology Inc.
(350) unused * "*" (from line *)
(Parser)
The indicated object was never used in the function or module being compiled. Either
this object is redundant, or the code that was meant to use it was excluded from com-
pilation or misspelled the name of the object. Note that the symbols rcsid and
sccsid
this object is redundant, or the code that was meant to use it was excluded from com-
pilation or misspelled the name of the object. Note that the symbols rcsid and
sccsid
are never reported as being unused.
(352) float parameter coerced to double
(Parser)
Where a non-prototyped function has a parameter declared as float, the compiler
converts this into a double float. This is because the default C type conversion con-
ventions provide that when a floating-point number is passed to a non-prototyped func-
tion, it will be converted to double. It is important that the function declaration be
consistent with this convention, for example:
converts this into a double float. This is because the default C type conversion con-
ventions provide that when a floating-point number is passed to a non-prototyped func-
tion, it will be converted to double. It is important that the function declaration be
consistent with this convention, for example:
double inc_flt(f) /* f will be converted to double */
float f; /* warning flagged here */
{
return f * 2;
}
(353) sizeof external array "*" is zero
(Parser)
The size of an external array evaluates to zero. This is probably due to the array not
having an explicit dimension in the extern declaration.
having an explicit dimension in the extern declaration.
(354) possible pointer truncation
(Parser)
A pointer qualified far has been assigned to a default pointer or a pointer qualified near,
or a default pointer has been assigned to a pointer qualified near. This may result in
truncation of the pointer and loss of information, depending on the memory model in
use.
or a default pointer has been assigned to a pointer qualified near. This may result in
truncation of the pointer and loss of information, depending on the memory model in
use.
(355) implicit signed to unsigned conversion
(Parser)
A signed number is being assigned or otherwise converted to a larger unsigned
type. Under the ANSI C “value preserving” rules, this will result in the signed value
being first sign-extended to a signed number the size of the target type, then con-
verted to unsigned (which involves no change in bit pattern). Thus an unexpected
sign extension can occur. To ensure this does not happen, first convert the signed value
to an unsigned equivalent, for example:
type. Under the ANSI C “value preserving” rules, this will result in the signed value
being first sign-extended to a signed number the size of the target type, then con-
verted to unsigned (which involves no change in bit pattern). Thus an unexpected
sign extension can occur. To ensure this does not happen, first convert the signed value
to an unsigned equivalent, for example:
signed char sc;
unsigned int ui;
ui = sc; /* if sc contains 0xff,
ui will contain 0xffff for example */
will perform a sign extension of the char variable to the longer type. If you do not want
this to take place, use a cast, for example:
this to take place, use a cast, for example:
ui = (unsigned char)sc;
(356) implicit conversion of float to integer
(Parser)
A floating-point value has been assigned or otherwise converted to an integral type.
This could result in truncation of the floating-point value. A typecast will make this warn-
ing go away.
This could result in truncation of the floating-point value. A typecast will make this warn-
ing go away.
double dd;
int i;
i = dd; /* is this really what you meant? */
If you do intend to use an expression like this, then indicate that this is so by a cast:
i = (int)dd;