Open jeffhammond opened 5 years ago
Hello Jeff. Sorry I completely forgot about this issue. I am not sure I understand what replacing restrict with restrict means, can you clarify? That said, this restrict seems to come from AC_PROG_CC_C99, I am not sure we want to duplicate/change that macro. I don't think I would be against adding some explicit mallocs, but I guess we'd need to add quite a lot of them. When configuring with gcc and building with CC=g++-8, I see quite a lot of other C++-related errors (arithmetic on enums, etc).
I'm pretty sure it was Github markdown eagerly transforming __restrict__
into restrict.
Note that for windows support, the correct keyword is __restrict
for Visual Studio, but I think GCC and Clang also accept that one.
I tried to build MPICH with the Intel C++ compiler . The configure step fails in hwloc configure, specifically the C99 step. I extracted the configure test and reproduced the errors (see below).
Only two changes are required to get this code to compile as C++:
s/restrict/__restrict__/g
I don't see any usage of
restrict
in hwloc and explicit casting of malloc, while potentially obnoxious, doesn't break anything.Is C++ compilation something that you are willing to support, if the changes were provided? This appears to require quite a few explicit casts on malloc.