Detected instability when built `flatbuffers-2.0.0` on `gcc-12`:
[ 75%] Building CXX object CMakeFiles/flattests.dir/tests/test_builder.cpp.o
.../c++/12.0.0/bits/shared_ptr_base.h:397:45: error: 'size' may be used uninitialized [-Werror=maybe-uninitialized]
397 | explicit _Sp_ebo_helper(_Tp&& __tp) : _M_tp(std::move(__tp)) { }
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from flatbuffers/tests/test_builder.cpp:1:
flatbuffers/tests/test_builder.h: In function 'void builder_move_assign_after_releaseraw_test(Builder) [with Builder = flatbuffers::FlatBufferBuilder]':
flatbuffers/tests/test_builder.h:63:10: note: 'size' was declared here
63 | size_t size, offset;
| ^~~~
...
In file included from flatbuffers/tests/test_builder.cpp:1:
flatbuffers/tests/test_builder.h: In function 'void builder_move_assign_after_releaseraw_test(Builder) [with Builder = GrpcLikeMessageBuilder]':
flatbuffers/tests/test_builder.h:63:10: note: 'size' was declared here
63 | size_t size, offset;
| ^~~~
cc1plus: all warnings being treated as errors
Here is the relevant bit of test:
template<class Builder>
void builder_move_assign_after_releaseraw_test(Builder b1) {
auto root_offset1 = populate1(b1);
b1.Finish(root_offset1);
size_t size, offset;
std::shared_ptr<uint8_t> raw(
b1.ReleaseRaw(size, offset), [size](uint8_t *ptr) {
flatbuffers::DefaultAllocator::dealloc(ptr, size);
});
Note how `b1.ReleaseRaw(size, offset)` is expected to populate `size`
and `[size](uint8_t *ptr) {` captures the result. But both are parameters
to the same function call and thus evaluation order is unspecified.
* Add flatc '--cpp_std' switch and sandbox for C++17 code generator
- Added 'flac --cpp_std legacy' for compatibility with old compilers (VS2010);
- Added experimental switch 'flac --cpp_std c++17' for future development;
- Added C++17 sandbox test_cpp17.cpp;
- C++ code generator generates enums with explicit underlying type to avoid problems with the forward and backward schema compatibility;
- Adjusted CMakeLists.txt, CI and generate code scripts to support of introduced '--cpp_std';
* Fix --cpp_std values: c++0x, c++11, c++17
* Add 'cpp::CppStandard' enum
* Add testing engine into test_cpp17
* Rebase to upstream/master
* Set default '--cpp-std C++0x'
* Fix code generation (--cpp_std C++11) in CMakeLists.txt
- Fix dependency declaration of grpctest target
* Revert --cpp-std for the tests from explicit C++11 to flatc default value (C++0x)
* Automatic refractor of C++ headers to Google C++ style guide
* Automatic refractor of C++ source to Google C++ style guide
* Automatic refractor of C++ tests to Google C++ style guide
* Fixed clang-format issues by running clang-format twice to correct itself. Kotlin was missing clang-format on after turning it off, so it was changed,
* Efficient conversion of FlatBufferBuilder to grpc::MessageBuilder
* Added a variety of tests to validate correctness of the MessageBuilder move operations.
Disable MessageBuilder half-n-half tests on MacOS.
* Fix failing Android build
* Generalized the MessageBuilder move constructor to accept a deallocator
armeabi support was removed from the Android NDK so we should no
longer build it. Since this fixes the Android build failures this
commit also re-enables Travis Android builds.
While re-enabling Android builds, some recent changes broke C++98
support so this fixes those issues as well which include:
- Conditionally compiling use of move constructors, operators and
std::move.
- Changing sample to use flatbuffers::unique_ptr rather than
std::unique_ptr.
Finally, added the special "default_ptr_type" value for the
"cpp_ptr_type" attribute. This expands to the value passed to
the "--cpp-ptr-type" argument of flatc.
* Add FlatBufferBuilder move semantics tests to main
Do not eagerly delete/reset allocators in release and release_raw functions
Update android, vs2010 build files
New tests for various types of FlatBufferBuilders and move semantics
* Improve test failure output with function names