it says while compiling that "converting from "localtime" to "localtime_s" possible loss of data" . i am compiling a C++ source module with VC6 then it compiles without any warnings but for the VC8 it gave me above stated warning which seems me dangerous.
any help will be appreciated
I am getting warning of possible loss of information when i compile any C++ module with VC8 compiler any sol?
The two calls use structures called localtime and localtime_s. They have different storage sizes. The compiler is simply telling you that 5 bytes are being put in a 4 byte space, you'll loose data, for example. Try looking up the time function that you are using and see if there is a secure version from the Win32s (as opposed to Win32) API. I'd bet there is and you'll need to use it in place of what you have now. This happens a lot, older code examples sometimes use the Win32 functions instead of the Win32 API current versions as a minimum. The secure versions are required by Windows 2000, Windows 2003 and of course, Windows XP. Whether you are writing this yourself or the older calls are still in your library and headers paths, this can hold you up until you find and set things right.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment