-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated C++ code for variable length data may not compile #796
Comments
This is a duplicate of #795 which has been fixed and will make the next release. |
This problem does not appear to be fixed by the resolution of #795. (1) The example change of "color" -> "Color" in the test schema still generates bad code with the current master (3b0d3f6). (2) #795 is referring to the same method but it is describing a different problem -- an interaction with |
@rogerorr Try building with head now. |
Thanks, the codegen looks good now. |
There seems to be a potential case mismatch when using a schema file with a variable length field.
There is inconsistent handling of the case of the first letter of the field name.
The C++ generated code creates an accessor method such as:
static SBE_CONSTEXPR std::uint64_t exampleHeaderLength() SBE_NOEXCEPT
but then attempts to call it inside:
SBE_NODISCARD static size_t computeLength(std::size_t ExampleLength = 0)
by invoking it as:
length += ExampleHeaderLength();
I encountered the issue updating from 1.12.2 to 1.82.2 and have reproduced it with the current code by changing the case of the last field in
sbe-tool/src/test/resources/code-generation-schema.xml
from "color" to "Color":java -Dsbe.target.language=CPP -Dsbe.target.namespace=test -jar sbe-all/build/libs/sbe-all-1.19.0-SNAPSHOT.jar sbe-tool/src/test/resources/code-generation-schema.xml
Testing the output:
The text was updated successfully, but these errors were encountered: