<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/153232>153232</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++] Removing C linkage causes build failures where OS provides some POSIX functions
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++,
platform:aix
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ZarkoT
</td>
</tr>
</table>
<pre>
Small test case:
```
cat vasprintf.cpp
#include <locale>
extern "C" int vasprintf (char **, const char *, va_list);
$>clang++_r -c vasprintf.cpp
vasprintf.cpp:3:16: error: declaration of 'vasprintf' has a different language linkage
3 | extern "C" int vasprintf (char **, const char *, va_list);
| ^
/home/zarko/llvm/dev/build/bin/../include/c++/v1/__locale_dir/locale_base_api/ibm.h:83:48: note: previous definition is here
83 | _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 2, 0) int vasprintf(char** strp, const char* fmt, va_list ap) {
| ^
1 error generated.
```
Looks like it's caused by this change to the linkage: https://github.com/llvm/llvm-project/pull/94102
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyslF2PqzYQhn_N5GZ0Imcc8nHBBclZpJVOtavdrVT1BhkzgLsGI9uk5_TXVybpfrS9qVRkYWzLM57nfbEKwXQjcw7ZCbKvKzXH3vn8V-Vf3cuqds2P_HlQ1mLkEFGrwCALEAXsxK2JQquIFxUmb8bYrvU0pXWSZtR2bhhBnq3TyjLIu7QiCv4e2Y8IRGcgQjN-2I9AB90rj0DF0s6o3Zhyv02e8aIqa0IEOoI8Ldm2IO-0VWMHdAI6VR6_6H8c6vNYFhJksdmBLJC9dz59NKyt8ioaN6JLh9m_bQLaY68CKmxM27LnMWLKOKuO0ZrxVXUMokBElAj7M_7vZeLypNCQLSip7N3AQOUfSS-g0trLAFQ2fAEq69nYJvVmBCrXa6DypglQqa-ggMrLBqisqqtGVWN8inMd1CpwpSaTdtbDugdZHBK07SGxGl1MbsDJ88W4OWDDrRnNws4E7NnfeByuPKpv96fz42NVvLw83Z9-frmryoenn4oXoENVXbFUVaqb0ksAHT8zuyG7EsMQ_fQZW5pth_iBHKopRYH9v9HbXFXHjkf2KnKz_puvQRTfnHsNaM0ro4lA-4BazYEbrH9g7E1IeceOMTqM_bsLZIF9jFNI_wqVQGVnYj_Xa-2Gd5FS92Xy7jfWEaicZmuByuN2I2jV5LI5yqNacb7ZZ5kgsRPZqs_lVh7kvt3us5qPUuhWH3daCCmOXLc75pXJSVAmDhva7LeSsrU-tFvdiJ1sDkex32jYCh6UseuUfu18tzIhzJxvMkmSVlbVbMNyGxBZU7_ZJGkCRJNVsXV-AFko8z1NZ19XPl9qqecuwFYk8OE9fDTRLtfLh2jZV3ziwV3M2OH5L2pXtAEX22KrjJ09B_w9-QgfnnHy7mIaDhjcwPj48Hz_C7bzqJPfwmr2Nv_PzJfSA1B5q_6S058BAAD__7EykFs">