fallback memset

Emmanuel Thomé Emmanuel.Thome at inria.fr
Thu May 27 18:32:00 CEST 2004


gmp-impl.h contains:

#if ! HAVE_MEMSET
#define memset(p, c, n)                 \
  do {                                  \
    ASSERT (n >= 0);                    \
    int  __i;                           \
    for (__i = 0; __i < (n); __i++)     \
      (p)[__i] = (c);                   \
  } while (0)
#endif


This may bite. I would suggest adding a cast of (p) to unsigned char *.

Regards,

E.


More information about the gmp-bugs mailing list