http://llvm.org/bugs/show_bug.cgi?id=21082
Bug ID: 21082
Summary: __attribute__((__format__(printf ignored for function
pointer members of struct
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
The following code
struct fmt_test {
void (*func)(const char *fmt, ...) __attribute__((__format__(printf, 1,
2)));
};
void (*g_func)(const char *fmt, ...) __attribute__((__format__(printf, 1, 2)));
int main(int argc, char *argv[])
{
struct fmt_test t;
t.func("Hello %s");
g_func("Hello %s");
return 0;
}
produces 1 warning
$ clang -Wall test.c
test.c:12:20: warning: more '%' conversions than data arguments [-Wformat]
g_func("Hello %s");
~^
1 warning generated.
I'd expect it to produce the same warning for the line that reads
t.func("Hello %s");
$ clang -v
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-redhat-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.2
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.3
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.3
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs