11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Error and Warning Messagesdouble inc_flt(f) /* the parameter f will be converted to double type */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 anexplicit 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 defaultpointer has been assigned to a pointer qualified near. This may result in truncation of the pointer andloss 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 theANSI "value preserving" rules, this will result in the signed value being first sign-extended to asigned number the size of the target type, then converted to unsigned (which involves no changein bit pattern). Thus an unexpected sign extension can occur. To ensure this does not happen, firstconvert the signed value to an unsigned equivalent, e.g.: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 takeplace, use a cast, e.g.: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 resultin truncation of the floating point value. A typecast will make this warning go away.271

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!