zserio
zserio copied to clipboard
Consider to filter out packed warning in templates
If the structure does not contain any packable field, Zserio compiler fires warning if such structure is used in packed array.
However, if such packed array is used in template, user cannot fix this warning. Therefore, consider to implement some possibility of filtering out this warning in templates.
Example:
struct Packable
{
uint32 id;
};
struct Unpackable
{
string text;
};
struct PackedTemplate<T>
{
packed T array[];
};
struct Warning
{
PackedTemplate<Packable> noWarning;
PackedTemplate<Unpackable> warning;
};
This example gives the following warning:
[WARNING] test.zs:19:5: In instantiation of 'PackedTemplate' required from here
[WARNING] test.zs:13:12: 'Unpackable' doesn't contain any packable field!
Consider to introduce new command line argument to enable this warning for empty structures as well (see #364).
It is just enough to create warning with new special specifier (tag) for this situation.