On Tue, 21 Jan 2025 00:34:39 GMT, Julian Waters <jwat...@openjdk.org> wrote:
>> src/jdk.accessibility/windows/native/bridge/AccessBridgeCalls.c line 233: >> >>> 231: return TRUE; >>> 232: } >>> 233: ((void) error); >> >> Not sure why do we need it. I mean there is a value assignment before so why >> would compiler complain? > > The error being cast to void is just there to mark that this was a place that > the compiler flagged, as for the warning itself, apparently just assigning > the value is not enough, as that yields a -Wunused-but-set-variable, it has > to actually be used somehow or explicitly be cast to void to stop the warning > altogether This may be useful in a debug build to look up the error if it occurs… Shall it be removed? >> src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp line 326: >> >>> 324: int regEnable() { >>> 325: HKEY hKey; >>> 326: // DWORD retval = -1; >> >> I don't think we need to comment out both retval and freeData. It is either >> remnants of the code that was long gone or (more likely) were just a copy of >> another template method that actually uses these variables. If variables are >> not used within the function i would just delete them. > > Will do, thanks I agree `retval` was probably used as a return value of the function; now there are explicit `return` statements. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21656#discussion_r1924377383 PR Review Comment: https://git.openjdk.org/jdk/pull/21656#discussion_r1923754007