Re: basic_string causes crash in _vsnprintf???
- From: muchan <qqn@xxxxxxxxxxx>
- Date: Fri, 24 Jun 2005 14:55:26 +0200
Hendrik Schober wrote:
WXS <WXS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
[...] I was wondering if anyone knows if a PCLint like product will detect this issue we could use on our code base?
I don't, but it seems that if you replace 'printf()' with some overloaded functions template and compile with that, you would be able to have compiler errors generated. Um, off the top of my head...
// beware, uncimpiled code ahead int printf(const char*)
template< typename T1 > int printf(const char*, T1) { testForStr<T1>(); }
.... (snip)
I tried this line of thinking, but last time I tried, I think problem was ambiguity, that "string" can be automatically casted to be std::string...
Maybe it works, by defining testForStr<const char*>() before testForStr<const std::string>() Maybe time to try again...
Thanks
muchan .
- Follow-Ups:
- Re: basic_string causes crash in _vsnprintf???
- From: Hendrik Schober
- Re: basic_string causes crash in _vsnprintf???
- References:
- basic_string causes crash in _vsnprintf???
- From: WXS
- RE: basic_string causes crash in _vsnprintf???
- From: WXS
- Re: basic_string causes crash in _vsnprintf???
- From: Hendrik Schober
- basic_string causes crash in _vsnprintf???
- Prev by Date: Re: basic_string causes crash in _vsnprintf???
- Next by Date: Re: basic_string causes crash in _vsnprintf???
- Previous by thread: Re: basic_string causes crash in _vsnprintf???
- Next by thread: Re: basic_string causes crash in _vsnprintf???
- Index(es):