Skip to content

error: using declaration referring to 'sprintf' with internal linkage cannot be exported #291

@ClausKlein

Description

@ClausKlein

clang++ on Linux with libstdc++ and import std;

build-and-test / clang 21 c++23 libstdc++ Release.Default

FAILED: [code=1] CMakeFiles/__cmake_cxx26.dir/Release/usr/share/libc++/v1/std.cppm.o CMakeFiles/__cmake_cxx26.dir/Release/std.pcm 
/usr/local/bin/clang++ -DCMAKE_INTDIR=\"Release\" -I/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../lib64/../share/libc++/v1 -stdlib=libc++ -O3  -O3 -DNDEBUG -std=gnu++26 -Wno-reserved-module-identifier -MD -MT CMakeFiles/__cmake_cxx26.dir/Release/usr/share/libc++/v1/std.cppm.o -MF CMakeFiles/__cmake_cxx26.dir/Release/usr/share/libc++/v1/std.cppm.o.d @CMakeFiles/__cmake_cxx26.dir/Release/usr/share/libc++/v1/std.cppm.o.modmap -o CMakeFiles/__cmake_cxx26.dir/Release/usr/share/libc++/v1/std.cppm.o -c /usr/share/libc++/v1/std.cppm
In file included from /usr/share/libc++/v1/std.cppm:199:
/usr/share/libc++/v1/std/cstdio.inc:24:14: error: using declaration referring to 'fprintf' with internal linkage cannot be exported
   24 |   using std::fprintf _LIBCPP_USING_IF_EXISTS;
      |              ^
/usr/include/bits/stdio2.h:123:1: note: target of using declaration
  123 | fprintf (__fortify_clang_overload_arg (FILE *, __restrict, __stream),
      | ^
In file included from /usr/share/libc++/v1/std.cppm:199:
/usr/share/libc++/v1/std/cstdio.inc:37:14: error: using declaration referring to 'printf' with internal linkage cannot be exported
   37 |   using std::printf _LIBCPP_USING_IF_EXISTS;
      |              ^
/usr/include/bits/stdio2.h:135:1: note: target of using declaration
  135 | printf (__fortify_clang_overload_arg (const char *, __restrict, __fmt), ...)
      | ^
In file included from /usr/share/libc++/v1/std.cppm:199:
/usr/share/libc++/v1/std/cstdio.inc:47:14: error: using declaration referring to 'snprintf' with internal linkage cannot be exported
   47 |   using std::snprintf _LIBCPP_USING_IF_EXISTS;
      |              ^
/usr/include/bits/stdio2.h:75:8: note: target of using declaration
   75 | __NTH (snprintf (__fortify_clang_overload_arg (char *, __restrict, __s),
      |        ^
In file included from /usr/share/libc++/v1/std.cppm:199:
/usr/share/libc++/v1/std/cstdio.inc:48:14: error: using declaration referring to 'sprintf' with internal linkage cannot be exported
   48 |   using std::sprintf _LIBCPP_USING_IF_EXISTS;
      |              ^
/usr/include/bits/stdio2.h:37:8: note: target of using declaration
   37 | __NTH (sprintf (__fortify_clang_overload_arg (char *, __restrict, __s),
      |        ^
In file included from /usr/share/libc++/v1/std.cppm:204:
/usr/share/libc++/v1/std/cwchar.inc:30:14: error: using declaration referring to 'swprintf' with internal linkage cannot be exported
   30 |   using std::swprintf _LIBCPP_USING_IF_EXISTS;
      |              ^
/usr/include/bits/wchar2.h:181:8: note: target of using declaration
  181 | __NTH (swprintf (__fortify_clang_overload_arg (wchar_t *, __restrict, __s),
      |        ^
5 errors generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions