On Tue, 1 Aug 2023 08:19:06 GMT, Julian Waters <jwat...@openjdk.org> wrote:
>> src/hotspot/os/windows/symbolengine.cpp line 114: >> >>> 112: _capacity = (int)(sizeof(_fallback_buffer) / sizeof(T)); >>> 113: } >>> 114: _p[0] = (T) '\0'; >> >> I find this use of `'\0'` quite suspicious in itself, but it is consistent >> with the use of `'X'` in `imprint_sentinel()`. I'm unclear what types are >> possible for `T` in this code. > > There are currently only 2 possible types of HMODULE and char/uint8_t for T > at the moment. Weirdly enough only line 126 errors out without the cast while > line 114, despite having the same problem, doesn't, but I added the cast to > both lines for consistency. If someone else knows why I could probably deal > with this code in a better way besides just casting it to T (which I also am > reluctant to do) I just checked and the value of the sentinel is ultimately the prvalue 88. I don't know if we'd want to replace all the weird char usages here with explicit values of 0 (and 88 for the sentinel). Maybe future reviews can help with that ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15096#discussion_r1285533375