On Mon, 9 Jan 2023 08:05:47 GMT, Thomas Stuefe <stu...@openjdk.org> wrote:
>> Ah I see. > > I like this, but would compilers not complain about unused statements? I don't believe so, at least not based on current options. Other projects use similar tricks, like ABSL_DCHECK from Abseil which short circuits expressions when in non-debug builds causing the code to be unreachable and stripped. If it does, we can always just remove the if statement part and have it evaluate anyway. Most compilers should realize that the statements are unused and should be pruned. ------------- PR: https://git.openjdk.org/jdk/pull/11702