<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 - __builtin___clear_cache() has a different prototype than GCC"
href="https://bugs.llvm.org/show_bug.cgi?id=48489">48489</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>__builtin___clear_cache() has a different prototype than GCC
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>alx.manpages@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>GCC provides:
void __builtin___clear_cache(void *begin, void *end);
See: <a href="https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html">https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html</a>
Clang provides:
void __builtin___clear_cache(char *begin, char *end);
I think GCC used char *' in the past, and moved to 'void *', but I'm not sure
about this. Please, use the same prototype that GCC uses, for compatibility
reasons.
I don't know much about internals of Clang/LLVM, but the only source I could
find that defines the types for the prototype is:
<a href="https://github.com/llvm/llvm-project/blob/7faf62a80bfc3a9dfe34133681fcc31f8e8d658b/clang/include/clang/Basic/Builtins.def#L583">https://github.com/llvm/llvm-project/blob/7faf62a80bfc3a9dfe34133681fcc31f8e8d658b/clang/include/clang/Basic/Builtins.def#L583</a>
If you can confirm that, or tell me which other sources need to be modified,
I'll be happy to submit a patch.
And a reminder to myself when this bug is closed: Update cacheflush(2) manual
page.
Related linux-man@ thread:
<a href="https://lore.kernel.org/linux-man/747d56e0-c102-ab40-add4-530a48a43a4d@gmx.de/T/#t">https://lore.kernel.org/linux-man/747d56e0-c102-ab40-add4-530a48a43a4d@gmx.de/T/#t</a></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>