If issues related to MSVS 8.0 should be posted somewhere else, I would appreciate a pointer in the right direction.
We are using MSVS 8.0.40426 (pd5.040426-1400) on Win32 XP
There looks to be a bug in __loctotime32_t (called from _stati64 which is actually _stat32i64) where EINVAL is incorrectly reported. Here is the code fragment from the Microsoft VC7 CRT. Notice that the first "if" has a side effect of modifying the parameter "yr"; however, the subsequent _VALIDATE_RETURN expects "yr" not to have been changed. Also note that yr is later decremented by 1900 again.
__time32_t __cdecl __loctotime32_t (
int yr, /* 0 based */
int mo, /* 1 based */
int dy, /* 1 based */
int hr,
int mn,
int sc,
int dstflag )
{
int tmpdays;
__time32_t tmptim;
struct tm tb;
/*
* Do a range check on the year and convert it to a delta
* off of 1900.
*/
if ( ((yr -= 1900) < _BASE_YEAR) || (yr > _MAX_YEAR) )
return (__time32_t)(-1);
_VALIDATE_RETURN(
( ( ( yr - 1900 ) >= _BASE_YEAR ) && ( ( yr - 1900 ) <= _MAX_YEAR ) ),
EINVAL,
( ( __time32_t )( -1 ) )
)
yr -= 1900;
--
Jason Hinsperger
Product Manager
iAnywhere Solutions