If you would like to turn off / suppress or disable certain XC8 Compiler warning or compiler error messages, it is very simple.
you can also turn errors off
Have you run into situation under the MPLAB IDE where you are trying to output variables, but even though you have the format correct, a float variable outputs with a .0 value?
(from somewhere else in code)
float adjustedtemp= 0.0;
adjustedtemp= (AIRTEMP + 5)/10;
printf("Air Temp: %5.2f \r\n", adjustedtemp);
the result looks like this
Air Temp: 75.00
when it SHOULD look like this
Air Temp: 75.60
this is due to a bug in the way MPLAB handles floats.
Two easy ways to fix it:
adjustedtemp= (AIRTEMP + 5.0)/10.0;
adjustedtemp= ((float)AIRTEMP + 5)/10;
Either of these methods will result in the correct value being displayed during your sprintf() or printf() command.
If you receive the following error during an XC8 project build, here is how to fix it
warning: (1472) –CODEOFFSET option ignored: duplicate or conflicting option
under project properties, XC8 Linker, make sure there is either
a) no value (blank) in the CODEOFFSET field
b) some legitimate value in CODEOFFSET that works with your bootloader
a ZERO — 0 — as pictured will cause this error during build.
if you receive the following error during BUILD in XC8, here is the quick fix:
warning: (1459) peripheral library support is missing for the 18F6722
the fix is simple:
make sure this checkbox is UNCHECKED under the project properties, XC8 linker.