The tool complains whether (alloc(size)+ofs) is intentional instead of
(alloc(size+ofs)). In our case, it is a false alarm (the offset is
added to the result to align the allocation at HBLKSIZE boundary).
* os_dep.c [USE_WINALLOC && MSWIN32] (GC_win32_get_mem): Store result
of GlobalAlloc() to "result" local variable first (then, perform result
alignment in a standalone statement); add comment.
/* VirtualAlloc doesn't like PAGE_EXECUTE_READWRITE. */
/* There are also unconfirmed rumors of other */
/* problems, so we dodge the issue. */
- result = (ptr_t)(((word)GlobalAlloc(0, SIZET_SAT_ADD(bytes, HBLKSIZE))
- + HBLKSIZE - 1) & ~(word)(HBLKSIZE - 1));
+ result = (ptr_t)GlobalAlloc(0, SIZET_SAT_ADD(bytes, HBLKSIZE));
+ /* Align it at HBLKSIZE boundary. */
+ result = (ptr_t)(((word)result + HBLKSIZE - 1)
+ & ~(word)(HBLKSIZE - 1));
} else
# endif
/* else */ {