This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/64862] New: 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 16:54:16 +0000
- Subject: [Bug c/64862] New: printf attribute should accept other string types
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64862
Bug ID: 64862
Summary: printf attribute should accept other string types
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: tromey at gcc dot gnu.org
Consider this source:
#include <stdarg.h>
#include <uchar.h>
extern void p (const char16_t *fmt, ...)
__attribute__((__printf__ (1, 2)));
void f()
{
p(u"%d\n", 23);
}
Currently gcc rejects this attribute:
pokyo. gcc --syntax-only -std=c11 -Wall r.c
r.c:5:3: warning: â__printf__â attribute directive ignored [-Wattributes]
__attribute__((__printf__ (1, 2)));
^
I don't see why it should, though.
It seems to me that it could accept wchar_t, char16_t, or char32_t
strings as the format argument.