mirror of https://github.com/vee1e/flatbuffers - FlatBuffers: Memory Efficient Serialization Library
Find a file
Sergei Trofimovich 85b4effac6
test: fix undefined order of functio parameters. (#6946)
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.
2021-11-22 12:14:31 -08:00
.appveyor Make and generate_code.sh generate same outputs (#6855) 2021-09-24 12:01:34 -07:00
.bazelci Remove ubuntu1604 from presubmit.yml (#6715) 2021-07-09 09:59:30 -07:00
.github WIP: Dart release 2.0 (#6927) 2021-11-18 10:56:29 -08:00
.travis Ran clang-format-all.sh. Removed default --style=file parameter (#6639) 2021-05-15 12:54:08 -07:00
android Removal of support for FLATBUFFERS_CPP98_STL (#6918) 2021-11-12 14:01:11 -08:00
bazel [grpc] Support latest version of grpc PoC (#6338) 2021-03-25 12:12:35 -07:00
benchmarks Added Raw C++ benchmarks (#6924) 2021-11-15 15:19:03 -08:00
CMake [cmake] Fix getting version info from tags during the build (#6936) 2021-11-22 11:53:50 -08:00
conan
dart WIP: Dart release 2.0 (#6927) 2021-11-18 10:56:29 -08:00
docs [C#] Using 'global::' as qualifying_start_ within BaseGenerator (#6767) 2021-09-15 16:57:29 -05:00
go GetUOffsetT must get value by GetUint32 not GetInt32 (#6072) 2021-02-18 18:38:25 -08:00
grpc Fix integer overflow warnings 2021-11-18 09:41:44 -08:00
include/flatbuffers clang-all (#6941) 2021-11-19 17:01:48 -08:00
java/com/google/flatbuffers [Java] lookup by byteArray is giving back wrong entry (#6915) 2021-11-15 11:16:45 -08:00
js
kotlin Updated main version numbers to 2.0 2021-05-10 11:14:47 -07:00
lobster
lua [Lua] manipulate byte array as string (#6624) 2021-05-07 22:57:13 -07:00
mjs
net/FlatBuffers Updated main version numbers to 2.0 2021-05-10 11:14:47 -07:00
php
python Fix warning about deprecated module: imp (#6362) 2021-06-17 13:02:22 -07:00
reflection Replace filenames in reflection with filenames+includes. (#6703) 2021-06-19 19:21:33 -04:00
rust Store vtables sorted in Rust builder (#6765) 2021-08-03 12:31:45 -07:00
samples [C++] Fix compile failure on Object API union construction for struct member (#6923) 2021-11-18 10:55:11 -08:00
scripts Adds JSON encoding to swift (#6874) 2021-10-07 23:22:22 +02:00
snap use improved versioning (#6691) 2021-06-11 15:27:59 -07:00
src clang-all (#6941) 2021-11-19 17:01:48 -08:00
swift Improves documentation, and adding DocC (#6784) 2021-09-27 20:59:19 +02:00
tests test: fix undefined order of functio parameters. (#6946) 2021-11-22 12:14:31 -08:00
ts Use ArrayBuffer type for JS flexbuffer's toObject (#6851) 2021-09-23 16:22:13 -07:00
.clang-format
.editorconfig
.eslintrc.js
.gitattributes
.gitignore Added Google benchmarks (and gtests) (#6920) 2021-11-15 13:41:22 -08:00
.travis.yml Limit formatter to pull requests only (#6540) 2021-04-01 20:09:43 +03:00
appveyor.yml
BUILD.bazel [C++] Split flatbuffers.h into separate files (#6868) 2021-11-10 22:26:09 -08:00
build_defs.bzl Add a split on ':' to build_defs.bzl (#6742) 2021-07-19 16:42:27 -04:00
CMakeLists.txt fixed cmp0048 error (#6932) 2021-11-17 20:22:23 -08:00
composer.json
conanfile.py
CONTRIBUTING.md
Formatters.md Ran clang-format-all.sh. Removed default --style=file parameter (#6639) 2021-05-15 12:54:08 -07:00
LICENSE.txt
package.json Bumped package.json to 2.0.4 2021-09-27 15:49:45 -07:00
pom.xml update Java version to 2.0.3 2021-08-14 09:01:54 -07:00
readme.md Update readme.md to point to security policy 2021-05-19 11:59:58 -07:00
SECURITY.md Create Security.md 2021-05-19 11:55:50 -07:00
swift.swiftformat Improves documentation, and adding DocC (#6784) 2021-09-27 20:59:19 +02:00
tsconfig.json
tsconfig.mjs.json
WORKSPACE [C++] Use proper gRPC C++ API when using MemoryBuffer Slice (#6756) 2021-07-29 10:41:51 -07:00

logo FlatBuffers

Build Status Build status Join the chat at https://gitter.im/google/flatbuffers Discord Chat Twitter Follow

FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.

Go to our landing page to browse our documentation.

Supported operating systems

  • Windows
  • MacOS X
  • Linux
  • Android
  • And any others with a recent C++ compiler.

Supported programming languages

  • C++
  • C#
  • C
  • Dart
  • Go
  • Java
  • JavaScript
  • Lobster
  • Lua
  • PHP
  • Python
  • Rust
  • TypeScript

and more in progress...

Contribution

To contribute to this project, see CONTRIBUTING.

Security

Please see our Security Policy for reporting vulnerabilities.

Licensing

Flatbuffers is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.