Closed SebaLukas closed 1 year ago
Example from generated code:
switch(eventCode)
{
case 0:
// Event: START (Reference, ReferenceType (ReferenceType)); next=106
// decode: element array
if (SignedInfoType->Reference.arrayLen < iso20_ReferenceType_4_ARRAY_SIZE)
{
error = decode_iso20_ReferenceType(stream, &SignedInfoType->Reference.array[SignedInfoType->Reference.arrayLen++]);
}
else
{
error = EXI_ERROR__ARRAY_OUT_OF_BOUNDS;
}
grammar_id = 106;
grammar_id = 106;
}
grammar_id = 106;
}
break;
default:
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
break;
}
3x grammar_id = 106 and too many braces
Do you happen to have old local fixes to the cbexigen code base which you forgot to revert? Is src/config.py
clean?
Indeed, ReferenceType used to be a single scalar, now it's corrected to an array.
I cannot reproduce this, and the code I produce (with Python 3.8.10, xmlschema 1.11.2, jinja2 3.1.2) does not show these artifacts, and compiles without warnings. (Still issues with WPT and ACDP though.)
I don't see the issues in your attached ZIP file, BTW:
case 105:
// Grammar: ID=105; read/write bits=1; START (Reference)
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
if (error == 0)
{
switch(eventCode)
{
case 0:
// Event: START (Reference, ReferenceType (ReferenceType)); next=106
// decode: element array
if (SignedInfoType->Reference.arrayLen < iso20_ReferenceType_4_ARRAY_SIZE)
{
error = decode_iso20_ReferenceType(stream, &SignedInfoType->Reference.array[SignedInfoType->Reference.arrayLen++]);
}
else
{
error = EXI_ERROR__ARRAY_OUT_OF_BOUNDS;
}
grammar_id = 106;
break;
default:
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
break;
}
}
break;
And your attached files compile cleanly, using:
clang -c -ggdb -fPIC -Wall -Wextra -Werror=unused-value -Werror=uninitialized $(for d in {common,iso-20}; do echo "-I$d"; done) {common,iso-20}/*.c
which corresponds to
clang -c -ggdb -fPIC -Wall -Wextra -Werror=unused-value -Werror=uninitialized -Icommon -Iiso-20 common/exi_basetypes.c common/exi_basetypes_decoder.c common/exi_basetypes_encoder.c common/exi_bitstream.c common/exi_header.c common/exi_types_decoder.c iso-20/iso20_AC_Datatypes.c iso-20/iso20_AC_Decoder.c iso-20/iso20_AC_Encoder.c iso-20/iso20_CommonMessages_Datatypes.c iso-20/iso20_CommonMessages_Decoder.c iso-20/iso20_CommonMessages_Encoder.c iso-20/iso20_DC_Datatypes.c iso-20/iso20_DC_Decoder.c iso-20/iso20_DC_Encoder.c
Thank you for your fast response :) I think i know the problem. Vscode does things it shouldn't do. Like messing with local changes and revert and combine too many things together.
Let me check that quick.
Yes it builds again :smile: By reverting through vscode there was a very weird code mix here, which of course does not build. I actually only wanted to revert the includes in the source files, since we split the includes and src files into separate folders.
Many thanks Moritz!!!
Hi :)
I checked out the current state 82976af today to add the latest improvements to my project. Now the generated code for the ISO20 decoders and encoders no longer builds.
Here is an snippet of the error message from g++/ninja:
Can you please take a look?
There seems to be something wrong with the generation of the decode and encode function of arrays.
Attached I have also added the generated code. Generated_c_ISO_20.zip