This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/64862] printf attribute should accept other string types
- From: "tromey at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Jan 2015 18:09:23 +0000
- Subject: [Bug c/64862] printf attribute should accept other string types
- Auto-submitted: auto-generated
- References: <bug-64862-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64862
--- Comment #2 from Tom Tromey <tromey at gcc dot gnu.org> ---
Naturally my example was wrong.
Sorry about that. But gcc still doesn't handle it:
#include <stdarg.h>
#include <uchar.h>
extern void p (const char16_t *fmt, ...)
__attribute__((format (__printf__, 1, 2)));
void f()
{
p (u"%s %d", 23, "hi");
}
... with gcc saying:
r.cc:5:44: error: format string argument is not a string type
__attribute__((format (__printf__, 1, 2)));
^