In both cases a `size_t` was being converted to a `uint32_t`. These headers are used from application code, or at least from generated code, and the application may be compiling with more warnings enabled than normal.
Closes#12762
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12762 from coryan:fix-avoid-warnings-with-MSVC 5ba6b5db1e
PiperOrigin-RevId: 531506224
This parser reduces binary code size between 1% and 20%, particularly of debug and sanitized builds, while improving aggregate performance.
Micro benchmarks may regress, but large system performance improves.
PiperOrigin-RevId: 531505892
DLLs get in the way of making these tables constexpr in the general case because cross-DLL references are not constant.
However, we need descriptor.proto tables to be constexpr so we keep constexpr there were we know it works. They do not reference other DLLs.
PiperOrigin-RevId: 531256398
When building protobuf with BUILD_SHARED_LIBS disabled, conformance_test_runner should link jsoncpp_static but not jsoncpp_lib.
Closes#12733
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12733 from semlanik:main 2ab4be6bb0
PiperOrigin-RevId: 530926843
- Make sure the hash flooding test actually does hash flooding. The technique used to choose the inputs stopped working when random seeding was added. Now we assert trees are used in the test so it won't silently break again.
- Improve test coverage for tree buckets.
- Update the hash flood test to use absl::Time/Duration.
- Improve the map tests to use long strings. This way we can test that the values are being properly destroyed. Small strings could be leaked without side effects because of SSO.
PiperOrigin-RevId: 530917835
This crash was due to the fact that we were passing `nullptr` as a `const
char*` parameter and relying on that implicitly converting into an empty
`absl::string_view`. `absl::string_view` supports that functionality, but
starting with C++17 its behavior changes since it's just a type alias for
`std::string_view`. `std::string_view` does not have any special conversion for
nullptr and so we were just getting crashes.
PiperOrigin-RevId: 530431663
CMake has fairly strict backwards compatibility behavior. Saying `cmake_minimum_required(VERSION 3.10)` has two effects:
- It requires CMake to be version 3.10 or higher
- It configures CMake to behave exactly as it did in version 3.10
The code used to override some policies to get newer behavior if it was available. The alternative syntax in this PR says "require at least 3.10, and use the behavior (when available) up to 3.26". We can omit policy overrides by doing so. It does not seem like any other policies are important, so we can use the simpler syntax.
Closes#12712
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12712 from coryan:cleanup-cmake-automatically-use-newer-policies 36db0fa17e
PiperOrigin-RevId: 530376446
- Move several operations from MapField/DynamicMapField into TypeDefinedMapFieldBase.
- Change MapIterator to keep an iterator inline instead of new/delete.
- Change RepeatedPtrField usage to always be RepeatedPtrField<Message>.
PiperOrigin-RevId: 530375616
Warnings in header files can be a problem for consumers that enable `/WX` (or `-Werror`). In this case, using `... & -align` produces a warning (C4146) with MSVC. The fix is to use equivalent expression `... & ~(align - 1)`, which was already used in the same file.
Fixes#12675Closes#12697
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12697 from coryan:fix-msvc-warnings-in-arena-align 835f3b489a
PiperOrigin-RevId: 530137165