07.04.2013 Views

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Diagnostics<br />

comparison between signed <strong>and</strong> unsigned<br />

One of the oper<strong>and</strong>s of a comparison is signed, while the other is unsigned. The signed<br />

oper<strong>and</strong> will be treated as an unsigned value, which may not be correct.<br />

comparison is always n<br />

A comparison involves only constant expressions, so the compiler can evaluate the run<br />

time result of the comparison. The result is always n.<br />

comparison is always n due to width of bit-field<br />

A comparison involving a bit-field always evaluates to n because of the width of the<br />

bit-field.<br />

comparison is always false due to limited range of data type<br />

A comparison will always evaluate to false at run time, due to the range of the data<br />

types.<br />

comparison is always true due to limited range of data type<br />

A comparison will always evaluate to true at run time, due to the range of the data<br />

types.<br />

comparison of promoted ~unsigned with constant<br />

One of the oper<strong>and</strong>s of a comparison is a promoted ~unsigned, while the other is a<br />

constant.<br />

comparison of promoted ~unsigned with unsigned<br />

One of the oper<strong>and</strong>s of a comparison is a promoted ~unsigned, while the other is<br />

unsigned.<br />

comparison of unsigned expression >= 0 is always true<br />

A comparison expression compares an unsigned value with zero. Since unsigned<br />

values cannot be less than zero, the comparison will always evaluate to true at run<br />

time.<br />

comparison of unsigned expression < 0 is always false<br />

A comparison expression compares an unsigned value with zero. Since unsigned<br />

values cannot be less than zero, the comparison will always evaluate to false at run<br />

time.<br />

comparisons like X

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

Saved successfully!

Ooh no, something went wrong!