<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - __attribute__((__format__(printf ignored for function pointer members of struct"
href="http://llvm.org/bugs/show_bug.cgi?id=21082">21082</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>__attribute__((__format__(printf ignored for function pointer members of struct
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>noselasd@fiane.mooo.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>