3485 : cast to 'volatile bit_field *' from smaller integer type 'uint16_t' (aka 'unsigned short')
I have hundreds of this warning.
typedef struct { uint8_t bit0 : 1, bit1 : 1, bit2 : 1, bit3 : 1, bit4 : 1, bit5 : 1, bit6 : 1, bit7 : 1; } bit_field; #define button1 (*(volatile bit_field *) (_SFR_ADDR(PINA))).bit0
the warnings point to every instance I use the defined ports
if (button1 == HIGH) { ... } led1 = LOW; etc...
as far as I understand, it is warning me that I am casting to a larger data type from a smaller data type?
Or does the warning come from the fact I am casting to a pointer to a struct?
I know it is just a warning but some warnings are very useful and I don't want to ignore them.
Also, I am using AS6.1 with Naggy extension.
I am building this for m2560.
And these are the compile options (which are default, i think)
-funsigned-char -funsigned-bitfields -Os -ffunction-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega2560 -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)"
Also, I cannot recall if I have seen these errors when I have not yet installed Naggy. I don't know if it is Naggy who generates these.