RFR: 8346132: fallbacklinker.cpp failed compilation due to unused variable

Julian Waters jwaters at openjdk.org
Wed Dec 18 05:24:36 UTC 2024


On Wed, 18 Dec 2024 04:39:49 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> A simple fix for removing an unused variable in fallbacklinker.cpp. This is needed for building zero jvm variant on macosx-x64.
>> 
>> Testing:
>> 
>> - [x] tier1
>> - [x] zero jvm variant build on macosx-x64
>
> src/java.base/share/native/libfallbackLinker/fallbackLinker.c line 168:
> 
>> 166:   // attach thread
>> 167:   JNIEnv* env;
>> 168:   (*VM)->AttachCurrentThreadAsDaemon(VM, (void**) &env, NULL);
> 
> I think the variable should be used! This code should be checking for a failed attach!

Agree with David here. Generally I comment out unused code errors rather than outright remove them for this very reason. Also fallbackLinker doesn't seem to be a C++ file?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22799#discussion_r1889632542


More information about the core-libs-dev mailing list