RFR: 8307160: [REDO] Enable the permissive- flag on the Microsoft Visual C compiler [v2]

Thomas Stuefe stuefe at openjdk.org
Tue Aug 8 19:54:36 UTC 2023


On Mon, 7 Aug 2023 08:14:41 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> 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

I wrote this code ages ago. I'm not sure what's weird or suspicious about it, though. The comment at the file's beginning explains this code's motivation.

The buffer was never thought to be used for something different than HANDLEs or characters, where the assignment of integer literals work. I often use char constants for sentinels as debugging aid. As for `'\0'`, that indicates to the casual code reader that this is a termination of a string, better than had I used a plain 0.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15096#discussion_r1287626062



More information about the client-libs-dev mailing list