This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: tm vs. std:.tm type in symbol name of std::time_put<>::put()


On Fri, 15 Sep 2017, Johan Alfredsson wrote:

I ran into a symbol name difference linking an executable compiled with
clang 5.0 vs. compiling with gcc 7.1.0 on Solaris/SPARC.

In bits/locale_facets_nonio.tcc, there is the following template:

template<typename _CharT, typename _OutIter>
_OutIter
time_put<_CharT, _OutIter>::
put(iter_type __s, ios_base& __io, char_type __fill, const tm* __tm,
const _CharT* __beg, const _CharT* __end) const

Looking at the symbol in libstdc++.so corresponding to the instantiation of
time_put<char, std::ostreambuf_iterator<char, std::char_traits<char>>>, it
is

_ZNKSt8time_putIcSt19ostreambuf_iteratorIcSt11char_
traitsIcEEE3putES3_RSt8ios_basePK2tmPKcSB_

This corresponds to (according to c++filt):

std::time_put<char, std::ostreambuf_iterator<char, std::char_traits<char> >
::put(std::ostreambuf_iterator<char, std::char_traits<char> >,
std::ios_base&, tm const*, char const*, char const*) const

Now, linking the executable compiled with clang 5.0 results in an error
about a missing symbol. That symbol is:

std::time_put<char, std::ostreambuf_iterator<char, std::char_traits<char> >
::put(std::ostreambuf_iterator<char, std::char_traits<char> >,
std::ios_base&, std::tm const*, char const*, char const*) const

where the difference is that the type tm is now std::tm.

It seems to me that std::tm should be the proper type here, but I might be
wrong.

Comments?

This was done on purpose when we changed __cplusplus from 1 to 199711, to avoid breaking the ABI. On Solaris, we will mangle std::tm as if it was ::tm until the next ABI break (probably not soon).

--
Marc Glisse


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]