This fixes two problems:
1. The project could be build when using own tags which does not follow the pattern v<major>.<minor>.<patch>.
2. The case "tag points to the commit" will be handled correctly by setting VERSION_COMMIT to 0.
This commit resolves https://github.com/google/flatbuffers/issues/7472
Co-authored-by: Axel Sommerfeldt <axel.sommerfeldt@gmail.com>
Added (for compiler versions that support it):
-Wmissing-declarations
-Wzero-as-null-pointer-constant
Then, fixes to problems identified by the extra warnings
Tested only on GCC 9.4.0
Adjusted the CPP code generator to output nullptr where appropriate,
to satisfy -Wzero-as-null-pointer-constant
Added a lot of 'static' declarations in front of functions,
to satisfy -Wmissing-declarations,
and wrap static function defs in anonymous namespaces.
There are advantages to both anonymous namespaces and static,
it seems that marking a function as static will not publish the name in
the symbol table at all, thus giving the linker less work to do.
With a change introduce in 385dda5c3785ed8d6a35868bc169f07e40e889087fd2edc66,
flatc was not able to emit code for Kotlin if a namespace is specified
and the folders do not exist. The fix create folders if neded.
Additional changes are introduced in gradle files to bring more visibility
to the error messages.
Co-authored-by: Derek Bailey <derekbailey@google.com>
* [C++] Rename template parameter U in make_span of stl_emulation.h
CPPRESTSDK defines a U macro therefore, calls to U() are problematic.
Rename U to W to avoid conflict.
* [C++] Make typenames of span_convertable and make_span more expressive
Co-authored-by: Derek Bailey <derekbailey@google.com>
* Vector of Tables equality
* support nullptr and fix for not being able to use auto in lambda
* use different std::equal overload
* use flatbuffers::unique_ptr
* go back to auto and clang-format fix
Change config.escape_keywords to AfterConvertingCase.
It avoids unecessay escaping since the generated native
structs have fields starting with a uppercase letter
and Go's keywords start with lowercase letters.
Co-authored-by: Derek Bailey <derekbailey@google.com>
* [golang] Add support for text parsing with json struct tags
Add struct tags to Go native structs generated when object API is used.
This allows to use the same JSON file as for C++ text
parsing(i.e. snake_case vs CamelCase) and thus enabling text parsing
for Go(when using object API).
* [golang] Add test for text parsing
Added small test to check and demonstrate text parsing in Go.
Also, ran clang-format on cpp file changes.
* grpc/compiler: Respect filename suffix and extension during code generation
grpc compiler is not respecting filename suffix and extension passed to
flatc CLI. This causes compiler to spit out incorrect code, which then
cannot be compiled without modification.
Following patch fixes the problem.
Note, I ended up removing some code introduced #6954 ("Have grpc include
file with correct filename-suffix given to flatc") in favour of keeping
sanity of the generator code.
Signed-off-by: Aman Priyadarshi <aman.eureka@gmail.com>
* tests: Add filename-suffix and filename-ext test files
* Test 1: Filename extension changed to "hpp".
* Test 2: Filename suffix changed to "_suffix".
* Test 3: Filename extension changed to "hpp" and suffix changed to "_suffix"
Signed-off-by: Aman Priyadarshi <aman.eureka@gmail.com>