google / google/emboss

Example of `$size_in_bits` from documentation fails to compile

Open
#73 4 comments 2 reactions 0 assignees View on GitHub
bug documentation
Dominant language
Python
Stars
92
Forks
30
PR merge metrics
No merged PRs in 30d

Description

The example provided in https://github.com/google/emboss/blob/master/doc/language-reference.md#size_in_bits-size-in-bits (using `bits FixedSize` and `struct Envelope` gives the following error when built with emboss:

```
error: Fixed-size type 'FixedSize' cannot be placed in field of size 64 bits; requires 4 bits.
0 [+8] FixedSize padded_payload
^^^^^^^^^
```

This seems to imply that `FixedSize` needs to be padded out to a whole byte increment. We should either:
* relax the restrictions around padding (auto-pad by default?), or
* fix the example to include the necessary padding

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.