I've got an MPLABX project and the latest version of the compiler seems to have gone insane with warnings,
I've cast everything I can think of and it's still all over my code.
Where is the conversion?
What is the Error number so I can disable it?
If I change it to, uint8_t addr = (PORTC & 7)*2; then no warning is given - even though it's going from 9 bit to 8 bit (I know it isn't really).
It seems to occur whenever << is used such as uint8_t temp=1<<pin;
I like to have my code error free so I can instantly see if a new error (or warning) has appeared.
However, XC8 is now warning me about stuff in library calls,
This is only an Advisory and I have a number, 1510 so I can use #pragma warning disable 1510 - yes, it's a warning.
The older versions of XC8 didn't do this - maybe I need to look for an archive. I'm using a new install on Linux hence the newer XC8.
How do I install old compilers in Linux?
Mike.
Code:
main.c:97:40: warning: implicit conversion loses integer precision: 'int' to 'uint8_t' (aka 'unsigned char') [-Wconversion]
uint8_t addr = (PORTC & (uint8_t)7)<<(uint8_t)1;
~~~~ ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
Where is the conversion?
What is the Error number so I can disable it?
If I change it to, uint8_t addr = (PORTC & 7)*2; then no warning is given - even though it's going from 9 bit to 8 bit (I know it isn't really).
It seems to occur whenever << is used such as uint8_t temp=1<<pin;
I like to have my code error free so I can instantly see if a new error (or warning) has appeared.
However, XC8 is now warning me about stuff in library calls,
Code:
/opt/microchip/xc8/v2.41/pic/sources/c99/common/Umul8.c:4:: advisory: (1510) non-reentrant function "___bmul" appears in multiple call graphs and has been duplicated by the compiler
This is only an Advisory and I have a number, 1510 so I can use #pragma warning disable 1510 - yes, it's a warning.
The older versions of XC8 didn't do this - maybe I need to look for an archive. I'm using a new install on Linux hence the newer XC8.
How do I install old compilers in Linux?
Mike.