lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Your complier version matches one of mine.

Try dropping the /D_CRT_SECURE_NO_DEPRECATE

I have also used the widechar version on CE and it works as well.

What locale are you using?

My experience is that most of the "safe" options introduced in
VC8 are a safe path to failure.

db

On 3/14/07, Peter Odding <xolox@home.nl> wrote:
David Burgess wrote:
 > Does not happen for my Lua build maybe the following
 > helps
 >
 > http://www.lua.org/bugs.html
 >
 > I have compiled the patched lua5.1.1 with
 >
 > vc6/vc7/vc8
 >
 > No problems on XP SP2.
 >
 > db

Thanks. Very strange. I've compiled the test-case below with the
following compiler version (same as my Lua build):

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42
for 80x86

And it still crashes on %c. Wondering what exactly is crashing :?

Sorry for the noise if this turns out to be a non-issue. Though I still
suggest adding a minimal supported subset to the manual under os.date if
possible (from the C standard Mark Edgar linked to? (thanks!)).

  - Peter

#include <windows.h>
#include <stdio.h>
#include <time.h>

int main(int argc, char ** argv)
{
     time_t now;
     struct tm *today;
     char buffer[1024];
     time(&now);
     today = localtime(&now);

     /* to verify the arguments are valid */
     strftime(buffer, sizeof(buffer), "Today is %A, day %d of %B in the
year %Y.\n", today);
     printf("%s", buffer);

     /* CRASH :-\ */
     strftime(buffer, sizeof(buffer), "%e...", today);
     printf("%s", buffer);

     return 0;
}

/* cl /TC /D_CRT_SECURE_NO_DEPRECATE test.c */
/* I guess this kind of stuff is the reason they deprecated it :P */