Open jnz86 opened 2 months ago
base = (map_base_t) map_base_t = { first : ("a" => bstr), second : ("b" => bstr), ?third : ("c" => bstr), }
I didn't have time to make it a more simple example. I suspect this is still an issue when removing the sub-types.
In C:
base.first.value = some_pointer; // OK base.second.len = 100; // OK base.third_present == true // OK base.third.third.value = some_pointer; // Why third.third.?
In types.h:
struct map_base_t_third { struct zcbor_string third; }; struct map_base_t { struct zcbor_string first; struct zcbor_string second; struct map_envelope_t_third third; bool third_present; };
As soon as a map member is made optional, instead of a member like the others, it becomes a map type itself.
Am I doing something wrong with the CDDL? Is this intended behavior? Workaround to get better structure naming?
Thanks for the report and testcase. Will look into this a bit to see if I can improve it.
I didn't have time to make it a more simple example. I suspect this is still an issue when removing the sub-types.
In C:
In types.h:
As soon as a map member is made optional, instead of a member like the others, it becomes a map type itself.
Am I doing something wrong with the CDDL? Is this intended behavior? Workaround to get better structure naming?