microsoft / ifc-spec

IFC format specification
Creative Commons Attribution 4.0 International
71 stars 7 forks source link

Divergence between syntax.function-declarator definition in the specification and .ifc produced by MSVC #59

Closed AndreyG closed 2 years ago

AndreyG commented 2 years ago

The definition of Syntax.FunctionDeclarator looks like

struct {
    SyntaxIndex parameters;
    SyntaxIndex eh_spec;
    SourceLocation left_paren;
    SourceLocation  right_paren;
}

in the specification right now (sec:ifc:SyntaxSort:FunctionDeclarator), so its sizeof should be equal 24, but entry_size in the partition "syntax.function-declarator" produced by MSVC (IFC-version 0.41) is equal to 44.

DarkArc commented 2 years ago

Gaby, looks like this still needs ~3 bytes of padding (or something else?) added, the additional fields bring the byte count up to 41 (adding 16 w/ the source locations and 1 with the function type traits).

Thanks

GabrielDosReis commented 2 years ago

Gaby, looks like this still needs ~3 bytes of padding (or something else?) added, the additional fields bring the byte count up to 41 (adding 16 w/ the source locations and 1 with the function type traits).

Ah. All structures are 4-byte aligned. The missing 3 bytes are the padding at the end of structure after the trait field.