Skip to content

[libc++] Removing C linkage causes build failures where OS provides some POSIX functions #153232

@ZarkoT

Description

@ZarkoT

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: #94102

Metadata

Metadata

Labels

libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.platform:aix

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions