Consider command line argument to disable "optional clause warnings"
When an optional field depends on another optional field or on an optional parameter, zserio tries to check that the optional clause for both fields is the same. However we are only able to compare the two expressions as strings and when the strings are not equal, we fire the warning, even when the expressions are semantically the same. The warning is still very useful to inform a user that something could be wrong, so it's not a good idea to remove the warning. However, to be able to write a warning free zserio source, we should be able to disable this warning at least from command line.
Consider to improve the evaluation of this warning as well. There are some obvious use cases where text compare is not enough but which can be solved anyway. Example:
struct OptionalValue
{
bool hasValue;
uint32 value if hasValue;
};
struct Holder(OptionalValue optionalValue)
{
ArrayHolder(optionalValue.value) arrayHolder if optionalValue.hasValue;
};
struct ArrayHolder(uint32 value)
{
uint8 array[value];
};
Warning:
[WARNING] example.zs:9:38: Parameterized field 'arrayHolder' has different optional clause than parameters.
Consider to improve the evaluation of this warning as well. There are some obvious use cases where text compare is not enough but which can be solved anyway. Example:
struct OptionalValue { bool hasValue; uint32 value if hasValue; }; struct Holder(OptionalValue optionalValue) { ArrayHolder(optionalValue.value) arrayHolder if optionalValue.hasValue; }; struct ArrayHolder(uint32 value) { uint8 array[value]; };Warning:
[WARNING] example.zs:9:38: Parameterized field 'arrayHolder' has different optional clause than parameters.
This will be solved within the scope of issue #360.
This will be done within scope of issue #422.