RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17
SendaoYan
syan at openjdk.org
Fri Dec 13 03:37:36 UTC 2024
On Thu, 12 Dec 2024 19:53:12 GMT, Phil Race <prr at openjdk.org> wrote:
>> src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c line 141:
>>
>>> 139: dladdr((void *)AWT_OnLoad, &dlinfo);
>>> 140: if (realpath((char *)dlinfo.dli_fname, buf) == NULL) {
>>> 141: perror((char *)dlinfo.dli_fname);
>>
>> Having error handling is better than no error handling, but is `perror` the best we can do?
>>
>> OTOH, maybe it doesn't matter as much. Something would be very, very broken if this were to fail.
>
> I saw this in another bug report too from the same submitter.
> I don't know that I want to encourage this as a pattern, except in debug builds. better might be to just copy dlinfo.dli_fname into buf ..
Hi @prrace,
> I saw this in another bug report too from the same submitter.
I did create 3 clang17 compile waring issues, the compile warings occur in different files, and maybe use should different solutions to solve the issue, so I create the separate issues.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1883209539
More information about the client-libs-dev
mailing list