-
Notifications
You must be signed in to change notification settings - Fork 936
Closed
Description
Passing --enable-mem-debug to configure leads to the following compiler error:
pshmem_free.c: In function ‘_shfree’:
pshmem_free.c:65:39: error: macro "free" passed 2 arguments, but takes just 1
rc = s->allocator->free(s, ptr);
^
pshmem_free.c:65:12: warning: assignment to ‘int’ from ‘int (*)(map_segment_t *, void *)’ {aka ‘int (*)(struct map_segment *, void *)’} makes integer from pointer without a cast [-Wint-conversion]
rc = s->allocator->free(s, ptr);
The culprit seems to be the definition of the macro free in opal_config_bottom.h, which is used to forward the file and line number information to opal_free. This is present in both master and the 4.x branches.
One possible fix is to rename the allocator struct members to avoid conflicts with memory debugging macro intercepts.
Thanks to @bertwesarg for discovering this.