Jason Moxham on Sat, 27 Jun 2009 00:01:29 +0200


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

Re: Pari svn on MSVC


in the file
src/language/es.c

in the function

/* print e to S (more efficient than sprintf) */
static void
str_ulong(outString *S, ulong e)
{
 if (e == 0) str_putc(S, '0');
 else
 {
   const int MAX = 21;
   char buf[MAX], *p = buf + MAX;
   *--p = 0;
   if (e > 9) {
     do
       *--p = "0123456789"[e % 10];
     while ((e /= 10) > 9);
   }
   *--p = "0123456789"[e];
   str_puts(S, p);
 }
}


char buf[MAX] is not recognized as a buffer of fixed lenght on MSVC v9.0 whereas clearly it is.
I'm not sure what to suggest for this , perhaps a

#define MAX 21

or

char buf[21] ;
chat *p=buf+sizeof(buf)/sizeof(buf[0]);

Jason