commit | cb971eece803c13c8a0dda3841dc1ab830164253 | [log] [tgz] |
---|---|---|
author | Anass Al <anassinator@fb.com> | Thu Oct 08 08:00:40 2020 -0700 |
committer | GitHub <noreply@github.com> | Thu Oct 08 08:00:40 2020 -0700 |
tree | 1f641175d7e10f594d850b4ebaf335ab57456079 | |
parent | 7b9e61fccffbaf9a673ae51f89c490508fd39670 [diff] |
[C++] Fix -Wnarrowing and -Woverflow due to signed bitfields on G++ ARM (#6163) Older versions of GCC (at least on ARM) complain about narrowing conversions and overflows when setting the reference index (defined as an 11-bit signed integer bitfield) to -1: ``` error: narrowing conversion of '-1' from 'int' to 'short unsigned int' inside { } [-Wnarrowing] error: conversion from 'short unsigned int' to 'short unsigned int:11' changes value from '65535' to '2047' ``` This is due to the signedness of integer bitfields (not explicitly signed or unsigned) being implementation-defined. This addresses this issue by explicitly defining the signedness of all the bitfields in `flatbuffers::TypeCode` in C++.
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.
and more in progress...
flatbuffers
tag for any questions regarding FlatBuffers.To contribute to this project, see CONTRIBUTING.
Flatbuffers is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.