Skip to content

Question about the choice of padding fields #9151

Description

@wlkrm

I noticed that FlatBuffers generates padding for c/cpp as individual fields, e.g.:

uint8_t padding0__;
uint8_t padding1__;
uint8_t padding2__;

instead of a single array:

uint8_t padding__[3];

I understand why FlatBuffers generates explicit padding and manually controls struct layout, but I couldn't find any documentation explaining the choice of individual padding fields versus arrays.

Was this a deliberate design decision? If so, what were the motivations?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions