]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Remove extern "C" from Ryu sources
authorPatrick Palka <ppalka@redhat.com>
Tue, 11 May 2021 17:19:46 +0000 (13:19 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 11 May 2021 17:19:46 +0000 (13:19 -0400)
commit84b384a16f388c68166b0603e50d0b477d0830a7
tree8ba180e228867e99c5d61522c6bdd38364fb9806
parent37407a2ae701c0a93377106a2938ab5474062fc3
libstdc++: Remove extern "C" from Ryu sources

floating_to_chars.cc includes the Ryu sources into an anonymous
namespace as a convenient way to give all its symbols internal linkage.
But an entity declared extern "C" always has external linkage even
from within an anonymous namespace, so this trick doesn't work in the
presence of extern "C", and it causes the Ryu function generic_to_chars
to be visible from libstdc++.a.

This patch removes the only use of extern "C" from our local copy of
Ryu along with some declarations for never-defined functions that GCC
now warns about.

libstdc++-v3/ChangeLog:

* src/c++17/ryu/LOCAL_PATCHES: Update.
* src/c++17/ryu/ryu_generic_128.h: Remove extern "C".
Remove declarations for never-defined functions.
* testsuite/20_util/to_chars/4.cc: New test.
libstdc++-v3/src/c++17/ryu/LOCAL_PATCHES
libstdc++-v3/src/c++17/ryu/ryu_generic_128.h
libstdc++-v3/testsuite/20_util/to_chars/4.cc [new file with mode: 0644]