stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: source/stdlib/time_put.cpp change
Date Thu, 29 Sep 2005 21:49:17 GMT
Kostas Pagratis wrote:
> Yea in the preprocessor the functions on lines ~2579 and ~2676 unravel
> to
> template< >
> char* __rw_put_time (const __rw_facet *facet, char *buf, unsigned int

Right, these are the problematic declarations in time_put.cpp.

[...]
> so is the fix ok?
> 
> 
> _RWSTD_SPECIALIZED_FUNCTION
> char* __rw_put_time (const __rw_facet *facet, char *buf, _RWSTD_SIZE_T
> bufsize,
>                      _STD::ios_base &flags, char fill, const std::tm
> *tmb,
>                      char fmt, char mod, int width, int prec)
> {...}
> 
> to 
> 
> #if (defined(__sgi) && defined(__host_mips))
> template<char*>
   ^^^^^^^^^^^^^^^
> #else
> _RWSTD_SPECIALIZED_FUNCTION
> #endif
> 
> char* __rw_put_time (const __rw_facet *facet, char *buf, _RWSTD_SIZE_T

No, this doesn't look okay. It's not well-formed C++.

I suggest you either go with my patch (adjusted as necessary for the
unats if you see them), or try this to see if it makes a difference:

   _RWSTD_SPECIALIZED_FUNCTION
   char* __rw_put_time<char*>(...

Martin

> bufsize,
>                      _STD::ios_base &flags, char fill, const std::tm
> *tmb,
>                      char fmt, char mod, int width, int prec)
> {...}
> 
> with the same done for wchar_t*?
> 
> Kostas Pagratis
> Consulting Engineer
> Rogue Wave Software
> a Quovadx(TM) Division
> (w) 303-545-3268
> (c) 303-817-1605
> 
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Thursday, September 29, 2005 2:15 PM
> To: Kostas Pagratis
> Cc: stdcxx-dev@incubator.apache.org
> Subject: Re: source/stdlib/time_put.cpp change
> 
> Kostas Pagratis wrote:
> 
>>I just wanted to clear a change through you before I submit.
>>time_put.cpp was causing the compiler (CC) to segfault:
>>Signal: Segmentation faultError: Signal Segmentation fault in phase
>>Scope Setup -- processing aborted
>>CC ERROR:  /usr/lib32/cmplrs/fecc died due to signal 4
>>CC ERROR:  core dumped
>>*** Error code 32
> 
> 
> Yes, this is a known problem documented here:
> http://issues.apache.org/jira/browse/STDCXX-22.
> 
> 
>> 
>>I traced the problem down to the implementation of char* __rw_put_time
>>and wchar_t* __rw_put_time.  After running the pre-processor, I found
>>that they were being declared as:
>>Template< > 
>>char* __rw_time_put(.....) etc.
>> 
>>So what I did was, if __sgi and __host_mips are defined, change
>>template< > to template<char*> and template<wchar_t*> and now it
>>compiles.  What do you think.
> 
> 
> It does? I've never seen this syntax. It's certainly not valid C++,
> unless what you meant was __rw_time_put<char*>(...).
> 
> I fixed it a little differently this week with this change:
> http://svn.apache.org/viewcvs.cgi?rev=292337&view=rev
> 
> But I've noticed some unsats in my tests that I haven't investigated
> yet. Unless they are a fluke I might either have to make the functions
> extern and adjust their declarations in one of our headers, or use the
> explicit template argument list.
> 
> Martin


Mime
View raw message