place to instantiate a template missing from libstdc++-v3.a

Benjamin Kosnik bkoz@redhat.com
Thu Sep 1 17:37:00 GMT 2005


> 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



More information about the Libstdc++ mailing list