<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - format string checker should apply to indirect function calls"
href="https://bugs.llvm.org/show_bug.cgi?id=47810">47810</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>format string checker should apply to indirect function calls
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>10.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</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>llvm@insonuit.org
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>The format string checker operates on direct function calls, but not indirect
function calls. Thus the following examples generates 2 warnings, not 3:
#include <stdio.h>
extern int notind(char *f, ...) __attribute__((__format__(printf, 1, 2)));
extern int (*ind)(char *f, ...) __attribute__((__format__(printf, 1, 2)));
int main(void)
{
printf("%d", "no");
notind("%d", "no");
(*ind)("%d", "no");
}
It would be useful if indirect function calls could be checked as well. I
tested on clang 6.0 and clang 10.0 (the builds I had at hand) but don't see any
relevant changes in trunk. Interestingly, gcc 9.3 does check indirect calls.</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>