RFR: 8339364: AIX build fails: various unused variable and function warnings [v2]
Magnus Ihse Bursie
ihse at openjdk.org
Tue Sep 3 05:55:18 UTC 2024
On Tue, 3 Sep 2024 02:25:16 GMT, David Holmes <dholmes at openjdk.org> wrote:
> Also doesn't a call like this trigger the warning about ignoring a function result, or have we disabled that one?
Such a warning would be horrible to have enable. Then you would have to read the value of every function that thought it should return a value, even if it was just intended as some additional information that perhaps not everyone wanted to use. (And then you could not just store it into a variable and ignore it, since that would trigger the "unused variable" warning! ;-))
I know IntelliJ can provide warnings when ignoring the return value of a few select JDK methods that are often used incorrectly, but then they had to annotate these specially. I don't know if there is any similar kind of annotation for clang/gcc that can warn about ignoring return values that really, really shouldn't be ignored, but I'd guess not.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20812#discussion_r1741464573
More information about the core-libs-dev
mailing list