Skip to content

In industrial scenarios, it is necessary to increase the processing of special data structures such as union and bit fields. #4

@wancy-x

Description

@wancy-x

At present, there is a very common data structure as follows:

typedef struct
{
	union
	{
		unsigned short word;
		struct
		{
			unsigned code1		:3;
			unsigned code2		:5;
			unsigned code3		:2;
			unsigned code4		:6;
		}block;
	}order;
	...
}

In order to be compatible with a large number of early module codes, this is a necessary data structure, and this data structure will be transmitted with high-level programming languages.

After careful study, the conclusion is that under the current use scenario, the union cannot be serialized in general, but can only be parsed in a targeted way. In consideration of the universality of Jstruct, it is recommended to negotiate the special data types that may be encountered at present and in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions