> On May 31, 2019, at 4:46 PM, Kim Barrett <kim.barr...@oracle.com> wrote: > >> On May 31, 2019, at 12:11 AM, Nick Gasson <nick.gas...@arm.com> wrote: >> >> /home/nicgas01/jdk/src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp:259:34: >> note: in instantiation of function template specialization >> 'Atomic::add<unsigned long, char *>' requested here >> char* touch_addr = Atomic::add(actual_chunk_size, &_cur_addr) - >> actual_chunk_size; >> ^ > […] > If I'm reading the gcc documentation for __sync_add_and_fetch > correctly, I think the following (completely untested) should work, > and won't cause Andrew to (I think rightly) complain about > type-punning reinterpret_casts. > > Though I wonder if this is a clang bug. (See below.) > > […] > The bug description says this warning only arises with clang. It > seems like clang is overdoing that as-if, and treating it literally as > uintptr_t all the way through to the result type.
Or don’t change the code at all here, and say that clang is not (currently) a supported compiler for this platform.