_VIRTUAL _InIt do_get(_InIt _First, _InIt _Last,
ios_base& _Iosbase, ios_base::iostate& _State,
void *& _Val) const
{ // get void pointer from [_First, _Last) into _Val
char _Ac[_MAX_INT_DIG], *_Ep;
errno = 0;
#ifdef _LONGLONG
int _Base = _Getifld(_Ac, _First, _Last, ios_base::hex,
_Iosbase.getloc()); // gather field
const _ULONGLONG _Ans =
(sizeof (void *) == sizeof (unsigned long))
? (_ULONGLONG)::strtoul(_Ac, &_Ep, _Base)
: ::_STOULL(_Ac, &_Ep, _Base);
#else /* _LONGLONG */
const unsigned long _Ans = ::strtoul(_Ac, &_Ep,
_Getifld(_Ac, _First, _Last, ios_base::hex,
_Iosbase.getloc())); // gather field, convert
#endif /* _LONGLONG */
if (_First == _Last)
_State |= ios_base::eofbit;
if (_Ep == _Ac || errno != 0)
_State |= ios_base::failbit;
else
_Val = (void *)(uintptr_t)_Ans; // deliver value
return (_First);
}
'type cast' : conversion from 'uintptr_t' to 'void *' of greater size
so, im trying to compile my graphic-engine but I get 2 warnings about the same thing.
the warning directs me to near the bottom of this code.. _Val = (void *)(uintptr_t)_Ans;
the warning i'm getting is warning C4312: 'type cast' : conversion from 'uintptr_t' to 'void *' of greater size
And I have no clue about what goes wrong :P
Not directly an answer to your question, but why on earth does this function even exist? I don't entirely grok what it is doing, but it appears to be an attempt to subvert the processing of old-fashioned iostreams to provide handling of void * pointers? In that case, modern iostreams already do this internally.
Quote:Original post by swiftcoder
it appears to be an attempt to subvert the processing of old-fashioned iostreams to provide handling of void * pointers
This is lines 517 to 545 of the xlocnum header from MSVC 2003. In other words, part of the implementation of iostreams.
In any case, this a /Wp64 warning that can be safely ignored, especially given that it's living in the compiler's own headers. /Wp64 produces a lot more false positives than useful warnings. I generally suggest disabling the setting.
Quote:Original post by SiCraneThat makes a lot more sense - I had assumed it was in the OP's own code.
This is lines 517 to 545 of the xlocnum header from MSVC 2003. In other words, part of the implementation of iostreams.
Quote:Original post by SiCraneQuote:Original post by swiftcoder
it appears to be an attempt to subvert the processing of old-fashioned iostreams to provide handling of void * pointers
This is lines 517 to 545 of the xlocnum header from MSVC 2003. In other words, part of the implementation of iostreams.
In any case, this a /Wp64 warning that can be safely ignored, especially given that it's living in the compiler's own headers. /Wp64 produces a lot more false positives than useful warnings. I generally suggest disabling the setting.
I have tried that, but when I disable the wp64 I get a memory failure.
"The instructions at "0x00340540" referenced memory at "0x001c00c". The memory could not be "read".
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement