This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: place to instantiate a template missing from libstdc++-v3.a


> On a platform using config/locale/generic/c_locale.cc and not having any
> of strtof(), finitef(), and finite(), the code makes use of isinf(),
> which is forced to be a template under certain additional conditions
> that are also met for this target. 

>From looking at cmath.h, I would be surprised if

   template<typename _Tp>
   int
    __capture_isinf(_Tp __f) { return isinf(__f); }

  template<typename _Tp>
    int
    isinf(_Tp __f) { return __gnu_cxx::__capture_isinf(__f); }

 isn't correctly inlined, leaving just a reference to the C99 isinf
function. If this isn't the case, it should be.

>Since everything gets compiled with
> -fno-implicit-templates, an instantiation of this template must be added
> somewhere, but to me adding it to config/locale/generic/c_locale.cc
> itself seems to be a rather bad idea. Hence I'd like to understand where
> the proper place for adding such an explicit instantiation would be.

You should fix the <cmath> header to inline this stuff.

-benjamin


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