RFR: 8365231: Don't build gtest with /EHsc
Kim Barrett
kbarrett at openjdk.org
Thu Aug 14 22:23:10 UTC 2025
On Thu, 14 Aug 2025 19:24:21 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> My guess is that MSVC C4530 needs to be disabled when building libgtest even when we're not enabling exceptions for the same reason that I expected that warning from our jfr/test_networkUtilization.cpp.
>
> That jfr test includes `<vector>`, and vector::at throws, and that apparently isn't protected by anything that knows about exceptions being disabled. (At least, that's the problem I ran into a while ago.) So even if it's never called, it still triggers the warning.
>
> googletest also includes `<vector>` in a bunch of places, so I'd expect the same issue there. Again, warnings even though that code is never called.
Not `<vector>`, it's `<ostream>` or one of those: `basic_ostream<...>::operator<<(double)` may throw. Didn't see
any warnings from `<vector>` so that one may have been fixed, but still, it looks like the MS stdlib triggers warnings
when building with exceptions disabled.
So assuming it passes testing, this change seems fine to me.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26721#issuecomment-3190020874
More information about the build-dev
mailing list