avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-chat] no compiler warnings from printf_P?


From: Britton Kerin
Subject: [avr-chat] no compiler warnings from printf_P?
Date: Tue, 17 Mar 2015 10:31:35 -0800

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]