__attribute__ printf in class methods

Yasushi Saito yasushi@cs.washington.edu
Tue Mar 16 01:39:00 GMT 1999


In an example like below,

struct foo {
    void method(const char*, ...) __attribute__ ((format (printf, 2, 3)));
};
main()
{
    foo x;
    x.method("hello %s", 10); // *** (10 shouldn't be passed to %s)
}

I think a printf format warning should be issued at line ***, but that
doesn't happen, even in the latest egcs-1.1.2. I'd appreciate if this
problem is fixed.

Thanks,
yaz



More information about the Gcc-bugs mailing list