On Thu, 26 Feb 2026 07:04:11 GMT, SendaoYan <[email protected]> wrote:

> With enable -Wsystem-headers explictly, gcc12 will generate the deprecated 
> warning, same to clang23.

Sorry I wasn't clear.

So we're agreed that there is a bug in gcc12, which is being hidden by the
suppression of warnings for system headers.

The question I really want an answer to is why isn't clang also treating these
files as system headers, and so similarly suppressing warnings for them? Its
failure to do so suggests to me there's a problem with the clang being used.
I originally thought perhaps there was some misconfiguration.  But it turns
out this is a known clang bug:
https://github.com/llvm/llvm-project/issues/76515 

It was introduced by this PR:
https://github.com/llvm/llvm-project/pull/70353
The discussion of that PR includes a report of exactly the issue being dealt
with here, with google test getting deprecation warnings.  It looks like that
wasn't adequately investigated; the reply was to turn off deprecation warnings
until able to update to a version of googletest that has fixed the issue.  But
the issue was never in googletest at all, it was a problem with this change.

Yuck!

I don't have a better idea of how to solve the specific problem than what you
are doing. But I would really like there to be some comment or followup issue
or something to give an indication of why it's being done and that it should
go away at some point.

And this bug may cause us further problems.  Anyone who tries to use
`std::stable_sort` is going to introduce a clang+glibc12 problem.  And turning
off deprecation warnings more widely isn't especially appealing.

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

PR Comment: https://git.openjdk.org/jdk/pull/29919#issuecomment-3972907670

Reply via email to