Backport from master. Sun C 5.14 supports C11 but not GCC
extensions, and so refuses to compile Emacs without this patch.
* src/alloc.c (lmalloc, lrealloc): Don't use INT_ADD_WRAPV on
size_t, as in general this macro is restricted to signed types.
if (laligned (p, size))
break;
free (p);
- size_t bigger;
- if (! INT_ADD_WRAPV (size, GCALIGNMENT, &bigger))
+ size_t bigger = size + GCALIGNMENT;
+ if (size < bigger)
size = bigger;
}
p = realloc (p, size);
if (laligned (p, size))
break;
- size_t bigger;
- if (! INT_ADD_WRAPV (size, GCALIGNMENT, &bigger))
+ size_t bigger = size + GCALIGNMENT;
+ if (size < bigger)
size = bigger;
}