SW500007 Microchip Technology, SW500007 Datasheet - Page 391

PICC-18 PRO

SW500007

Manufacturer Part Number
SW500007
Description
PICC-18 PRO
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC18r
Datasheets

Specifications of SW500007

Supported Families
PIC18
Core Architecture
PIC
Software Edition
Professional
Kit Contents
Software And Docs
Mcu Supported Families
PIC18
Tool Function
Compiler
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
PIC18 Series
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
015P
778-1002
778-1002
Error and Warning Messages
will produce code that sets a to 5, then immediately sets b to 6. No code will be produced for the
comparison if(a == 4). If a was a global variable, it may be that other functions (particularly
interrupt functions) may modify it and so tracking the variable cannot be performed.
expression with missing or badly placed parentheses, causing the evaluation to yield a value different
to what you expected.
an infinite loop, use for(;;).
In this case the code generator can again pick up that a is assigned the value 0, then immediately
checked to see if it is equal to 10. Because a is modified during the for loop, the comparison
code cannot be removed, but the code generator will adjust the code so that the comparison is not
performed on the first pass of the loop; only on the subsequent passes. This may not reduce code
size, but it will speed program execution.
(758) constant conditional branch: possible use of = instead of ==
There is an expression inside an if or other conditional construct, where a constant is being assigned
to a variable. This may mean you have inadvertently used an assignment = instead of a compare ==,
e.g.:
will assign the value 4 to a, then , as the value of the assignment is always true, the comparison can
be omitted and the assignment to b always made. Did you mean:
This warning may indicate more than an optimization made by the compiler. It may indicate an
This warning may also be issued because you have written something like while(1). To produce
A similar situation arises with for loops, e.g.:
{
{
int a, b;
a = 5;
if(a == 4) /* this can never be false; always perform the true statement */
int a, b;
for(a=0; a!=10; a++) /* this loop must iterate at least once */
int a, b;
if(a = 4) /* this can never be false; always perform the true statement */
b = 6;
b = func(a);
b = 6;
(Code Generator)
377

Related parts for SW500007