summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-12-07[C++] Switch `flatc` to `--cpp-std c++11` C++ code generator (#6306)Vladimir Glavnyy13-287/+168
Prior to this commit the default C++ code generator was `c++0x`. A code generated with `c++0x` code-gen might have a vulnerability (undefined behavior) connected evolution of enums in a schema. This UB could break the backward compatibility if previously generated code casts an unknown enumerator to enum type that knows nothing about future enumerators added to the schema. The main differences between `c++0x` and `c++11`: - generated enums use explicitly declared underlying type; - generated object-API tables don't declare default ctor() explicitly, instead of it default data member initializers are generated. Please use `flatc --cpp-std c++0x` option for backward compatibility with old compilers.
2020-12-07[idl_parser] Unify parsing of NaN values read from .fbs and .json files (#6296)Vladimir Glavnyy7-8/+55
This commit unifies parsing of NaN values read from .fbs and .json files by converting them to unsigned NaN.
2020-12-03Moved various language tests from AppVeyor to GitHub Actions (#6300)Wouter van Oortmerssen2-40/+111
2020-11-24Documentation updates for Optional Scalars (#6014) (#6270)Casper3-78/+100
* Documentation updates for Optional Scalars * Updated Support * Reword stuff * s/NULL/null Co-authored-by: Casper Neo <cneo@google.com>
2020-11-23[C++] Add ParseJson(), Parser(Parser&&), update fuzzers (#6284)Vladimir Glavnyy16-41/+410
- add a new method ParseJson to minimize failures during fuzzing - add default (conditional) move-constructor for Parser - add a new monster_fuzzer - switch fuzzers to C++17 and `test/cpp17` generated code
2020-11-23Fixed FlexBufferBuilder asserting on duplicate keysWouter van Oortmerssen2-3/+15
2020-11-19Added a few more paths for auto labeler (#6281)Derek Bailey1-0/+9
2020-11-19Add --require-explicit-ids to require explicit ids (#6277)Austin Schuh4-4/+20
* Add --require-explicit-ids to require explicit ids We just got bit by a well intentioned developer forgetting that field order by default is the field index. 3 people missed it in review. I'm looking at ways to make it harder to mess up. We are requesting that developers explicitly id all fields in tables. Automatic (opt in for others) enforcement of this will help the effort succeed. This patch adds a command line flag which lets the user require ids on all fields in tables. * Added docs to Compiler.md as well
2020-11-19idl_gen_json_schema.cpp: Changed generation of array element types (#6253)schoetbi3-30/+39
* idl_gen_json_schema.cpp: Changed generation of array element types #6175 * idl_gen_json_schema.cpp: Simplified indent generation as suggested by @vglavnyy #6175
2020-11-19fix typo (#6280)Kelvin Hu1-1/+1
2020-11-19Updated Ms build Action to fix build issue (#6279)Derek Bailey1-1/+1
2020-11-16Add type annotation to unspecified array (#6264)James Kuszmaul1-2/+2
The lack of any type on the `ret` variable was causing our typescript compiler to complain.
2020-11-16[Swift] Adds a format file and reformats the swift project (#6250)mustiikhalil39-4480/+5079
* Formats files & adds licence * Revert arrays * Keeps array indentation as is * Adds licence to code formatter * Updates code generators
2020-11-15Adds a fix for enum generation (#6263)mustiikhalil1-1/+0
2020-11-13Experimental fix for failing oss-fuzz coverage build (#6259)AdamKorcz1-1/+1
2020-11-13BREAKING: Rust flexbuffers serde human readable set to false (#6257)Casper3-1/+19
Co-authored-by: Casper Neo <cneo@google.com>
2020-11-12Update to flags in fuzzing-cmake file (#6256)AdamKorcz1-3/+12
2020-11-12Remove _POSIX_C_SOURCE and _XOPEN_SOURCE definitions when compiling o… (#6205)Jason Lenz1-0/+3
* Remove _POSIX_C_SOURCE and _XOPEN_SOURCE definitions when compiling on OpenBSD * Only define _POSIX_C_SOURCE and _XOPEN_SOURCE for mingw/cygwin platforms * Only define POSIX statements for mingw/cygwin/qnx platforms
2020-11-12flatc should support --binary --schema with optional scalar fields. (#6252)Stefan F1-1/+2
* Added missing EndTable() call to VerifyObject() VerifyObject called VerifyTableStart() but not EndTable(). This made Verifier::VerifyComplexity() increase depth_ with each table, not with the depth of tables. https://groups.google.com/forum/#!topic/flatbuffers/OpxtW5UFAdg * Added Check to VerifyAlignment https://stackoverflow.com/questions/59376308/flatbuffers-verifier-returns-false-without-any-assertion-flatbuffers-debug-veri * Add GetStringView (Convenience function to get string_view from a String returning an empty string_view on null pointer) like GetString, GetCstring * flatc should warn, when an attribute is attached more than once. flatc.exe -b duplicate.fbs warning: duplicate.fbs(5, 36): warning: attribute already found: priority duplicate.fbs: namespace MyGame; attribute "priority"; table Monster (priority:1, priority:2) { } root_type Monster; * flatc should support --binary --schema with optional scalar fields. This fixes 'error: Optional scalars are not yet supported in at least one the of the specified programming languages.' when calling flatc.exe --binary --schema with a schema containing optional scalars.
2020-11-12Bump version of rules_go to 0.24.5 (#6234)Ivo List1-3/+3
Versions of rules_go below 0.24 include platforms repository, which are lacking definitions of os:macos, cpu:arm64 constraints. This definitions are needed to properly select toolchains in latest bazel.
2020-11-12Union As Accessors for C# (#6251)Derek Bailey3-2/+42
* Union As Accessors for C# * Changed loop to be compatible with older compilers * errant change fix
2020-11-09Resets buffer without deallocating current pointer (#6247)mustiikhalil2-3/+1
Resets buffer without deallocating current pointer & Bumps version
2020-11-05Add GetBufferSpan() function to bufferbuilder (#6235)OptoCloud1-0/+8
This will return the finished internal buffer data as a span
2020-11-05Modernize android build and sample (#6229)Paulo Pinheiro54-1285/+897
Android build was dated, using the Android.mk approach. Current project configuration on Android encourages the usage of CMake, so we are updating the android project as an example on how to use either the Java/Kotlin generate code or the native C++ one.
2020-11-05Added required-nested-flatbuffer to monster_test and fixed rust (#6236)Casper21-539/+1044
Co-authored-by: Casper Neo <cneo@google.com>
2020-11-05Notify based on Labelling issues and PR (#6241)Derek Bailey1-0/+17
2020-11-05Converted globs to use single quotes (#6240)Derek Bailey1-15/+16
2020-11-05More adjustments to the auto labeler (#6239)Derek Bailey2-4/+4
2020-11-05Updated Lua labeller glob (#6238)Derek Bailey1-1/+1
2020-11-05Support size-prefixed buffers and add tests for size-prefixed messages (#6232)Charlie Yin15-33/+233
2020-10-31Removes duplicate swift in labeler (#6228)mustiikhalil1-6/+0
Removed grpc tag from swift label set & removes duplicate swift label
2020-10-30Added more labels for auto labeler (#6227)Derek Bailey1-0/+49
2020-10-30[C#] Optional Scalars (#6217)Derek Bailey11-22/+758
* [C#] Optional Scalars * Moved scalar optional check to avoid null enum conversion
2020-10-30[Label Bot] Add Java and Kotlin support for the label bot (#6226)Paulo Pinheiro1-1/+9
CI is an unrelated timeout.
2020-10-29Implement `Debug` trait for Rust flatbuffers. (#6207)Casper12-27/+508
* Refactor idl_gen_rust to a ForAllX continuation pattern. * Removed unneeded SetValue and updated sample rust gencode * Make Rust flatbuffers print right * Generated code and removed unnecessary trait constraint * bumped rust version. Release required * removed an unwrap in Rust Debug-print unions * Tested formatting flatbuffers in rust. * Set float precision in flaky debug-print test * impl Debug for structs too Co-authored-by: Casper Neo <cneo@google.com>
2020-10-29[Label Bot] Adds some languages to labeler bot (#6222)mustiikhalil1-0/+22
* Adds swift, ts, go, py to labeler bot * Removes unneeded dir search
2020-10-28Auto Labeler Setup, Just C# for now (#6221)Derek Bailey2-2/+2
2020-10-28Auto Labeler Setup, Just C# for now (#6218)Derek Bailey2-0/+32
* Auto Labeler Setup, Just C# for now * Removed trailer comma as that might caused the issue * Removed any[]. * Changed .cs glob
2020-10-28Updated comments and fixed a fundamental type error. (#6214)Casper2-6/+5
* Updated comments and fixed a fundemental type error. * bump rust flatbuffers semver Co-authored-by: Casper Neo <cneo@google.com>
2020-10-28optional scalars for ts/js (#6215)Kamil Rojewski7-42/+1573
* optional scalars for ts/js * removed range based for * removed range based for
2020-10-27Adds NetTest.bat to run .NET Core tests on Windows (#6216)Derek Bailey2-1/+22
2020-10-26[Java] Implement optional scalars (#6212)Paulo Pinheiro7-19/+394
Java implementation of optional scalars, following issue #6014.
2020-10-26Empties the sharedString map on reset on go and csharp (#6187)mustiikhalil4-1/+48
Fixes go tests
2020-10-25Removed C# references from java generator. Move annotations closer to ↵Derek Bailey3-21/+16
definitions (#6204)
2020-10-25Adds readable size to asserts in read functions (#6210)mustiikhalil1-5/+7
2020-10-24Refactor idl_gen_rust (#6206)Casper2-269/+196
* Refactor idl_gen_rust to a ForAllX continuation pattern. * Updated rust sample code Co-authored-by: Casper Neo <cneo@google.com>
2020-10-22Fix typo in flatbuffers::span declaration. (#6202)Vladimir Glavnyy1-5/+5
2020-10-22Kotlin test optional enum (#6201)Paulo Pinheiro18-106/+86
* Add test for optional enums in Kotlin * Rename optional_scalars2.fbs into optional_scalars.fbs Also updated all references in the project to point to "optional_scalars.fbs" instead of "optional_scalars2.fbs".
2020-10-20Mass Refactoring to use `IsString` and other BASE_TYPE helpers (#6193)Casper15-128/+125
* Updated SupportsAdvancedUnionFeatures to look out for string * Mass refactoring to use BASE_TYPE helper functions. Co-authored-by: Casper Neo <cneo@google.com>
2020-10-19Updated SupportsAdvancedUnionFeatures to look out for string (#6190)Casper2-2/+6
Co-authored-by: Casper Neo <cneo@google.com>