Hi,
I think there is good reason, why AVR in default work with int instead of
unsigned long (RAM bit wide). If you do not like this warning, just
explicitly retype this constant.
Reason, why warning is not in second case, is fact, that flash is 16bit
wide,  so it is good reason to use 16 bit values, right? It made
implementation easier.
Regards
   Martin
On 18 Mar 2015 03:31, "Britton Kerin" <[email protected]> wrote:

> I notice that this:
>
>         printf ("should be long unsigned: %lu\n", 42);
>
> generates a nice warning:
>
>      one_wire_slave.c:358:9: error: format ‘%lu’ expects argument of
> type ‘long unsigned int’, but argument 2 has type ‘int’
> [-Werror=format=]
>               printf ("should be long unsigned: %lu\n", 42);
>               ^
>      cc1: all warnings being treated as errors
>
>
> but this:
>
>         printf_P (PSTR ("should be long unsigned: %lu\n"), 42);
>
> doesn't.
>
> Might it be possible to make printf_P generate that sort of warning
> also by adding a function attribute?
>
> Britton
>
> _______________________________________________
> AVR-chat mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/avr-chat
>
_______________________________________________
AVR-chat mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to