flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

Make STL dependencies optional

Open sesceu opened this issue 2 years ago • 6 comments

We're using flatbuffers in an embedded, real-time C++ environment and it's working great. Thank for for this great lib.

We'd like to extend usage into safety critical systems, however some compilers there, like the Arm Compiler for Embedded FuSa doesn't provide a safety certified STL.

It would be nice to have the option (at least for the runtime part of flatbuffers) to disable the STL usage, i.e. via introducing a NO_STL flag.

sesceu avatar Oct 31 '22 13:10 sesceu

Just following up on this. This is for reading a flatbuffer binary, not the generation of flatbuffer binaries? I think if we just support reading, it should be doable, the generation is a bit more work to support.

dbaileychess avatar Nov 13 '22 19:11 dbaileychess

Otherwise you could use the C bindings, but that would require a rewrite of the interfacing user code.

mikkelfj avatar Nov 13 '22 22:11 mikkelfj

Yes @mikkelfj I had suggested this independently but I couldn't state if the C bindings would be 100% compatible with those generated by flatc.

dbaileychess avatar Nov 14 '22 00:11 dbaileychess

As a maintainer of FlatCC, I am not aware of any binary incompatibilities between C and C++, but obviously it is not compatible at the source code level. There are some minor differences in the flatc vs flatcc schema compiler in that certain attributes specific to other languages as well as some deeply recursive schemas across multiple included files might not be supported in FlatCC. (EDIT: and FlatCC is routinely used by C++ projects that cannot work with flatc's C++ requirements).

mikkelfj avatar Nov 14 '22 08:11 mikkelfj

Hello everyone . Please is this where we are to include the flags https://github.com/google/flatbuffers/blob/6f895f54c25aa19f5d84ac6cf7fa8bc955a14e1d/tests/swift/tests/SwiftTest.sh#L19

like this

--no_stl

Forchapeatl avatar Nov 16 '22 06:11 Forchapeatl

@Forchapeatl We haven't implemented it yet.

dbaileychess avatar Nov 22 '22 22:11 dbaileychess

What we should do first is better separate the includes into the runtime components and the building components. That way we can better reduce the scope of such a change.

dbaileychess avatar Jan 07 '23 20:01 dbaileychess

This issue is stale because it has been open 6 months with no activity. Please comment or label not-stale, or this will be closed in 14 days.

github-actions[bot] avatar Jul 08 '23 20:07 github-actions[bot]

This issue was automatically closed due to no activity for 6 months plus the 14 day notice period.

github-actions[bot] avatar Jul 23 '23 20:07 github-actions[bot]