[Bug c/60654] New: format warnings don't work with PROGMEM/PSTR

code at dawg dot eu gcc-bugzilla@gcc.gnu.org
Tue Mar 25 15:42:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60654

            Bug ID: 60654
           Summary: format warnings don't work with PROGMEM/PSTR
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: code at dawg dot eu
            Target: avr

cat > bug.d << CODE
#include <avr/pgmspace.h>

void foo(PGM_P fmt, ...) __attribute__((format(printf, 1, 2)));
void foo(PGM_P fmt, ...)
{
}

void main()
{
    foo(PSTR("foobar"), 12); // broken
    foo("foobar", 12); // works
}
CODE

avr-gcc -mmcu=atmega8 -Wformat -c format.c



More information about the Gcc-bugs mailing list