td_var: avoid arithmetic on a pointer to void cast (#1096)
authorCheng Li <cheng.li@rutgers.edu>
Thu, 8 Oct 2020 18:22:34 +0000 (11:22 -0700)
committerCheng Li <chenglii@cs.rutgers.edu>
Thu, 8 Oct 2020 18:28:56 +0000 (11:28 -0700)
commit291945b12d15bf02c0fa63f46822e8c78325eab2
tree46b8a4264ca8314fc513ef866f7b65493f72f597
parent7064f8942a3b8070acf60b8e5fabc16f8221ae40
td_var: avoid arithmetic on a pointer to void cast (#1096)

Issue 1096 shows that a compiler complains an `arithmetic on a pointer to
void` error when `-Wpointer-arith` is turned on in Makefile. Although
there are many violating instances, we only fix the one in `parse.h`
because it is shared across many core source code files. This patch fixes
the `arithmetic on a pointer to void` issue by casting it to a uintptr_t
type first and perform manipulation, and then cast it back to void* type.

Signed-off-by: Cheng Li <chenglii@cs.rutgers.edu>
parse.h