[roll] Roll fuchsia [fidl][cpp] Audit bits API with respect to unknown members

It seems safe for operations to avoid introducing unknown bits
accidentally, but at the same time the flexible bits is designed to
explicitly carry and reason about unknown bits.

After looking at the way bits APIs are used, we propose the following
invariant: bitwise operations should not introduce unknown bits
unless a corresponding unknown bit occur in the source operands.
This means that one could perform OR, XOR, AND, etc over flexible
unknown bits with unknowns naturally as if they are numbers. At the
same time, when using strict bits, OR, XOR, AND will not give unknowns.

Bitwise NOT is almost always used like so:

    some_bits &= ~Bits::FOO;

i.e. it's used to clear some bit. This is problematic because bitwise
NOT will mask out the unknown bits. As a result the combined
`somebits &= ~Bits::FOO` operation will drop any unknown bit inside
`somebits`, whether the user intended or not. To mitigate this, we add
another operation "bitwise difference" to the binding spec and C++
bindings, which does not drop unknown bits. The Rust bindings should
also support this out-of-the-box from the bit_flags crate.

During the API review folks worried that XOR would introduce unknown
bits but it turns out that was not the case.

Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/760439
Original-Revision: d0f83e4c62a0c07e7bc12cf9070844fdc0012164
GitOrigin-RevId: 05f277c31d13d313404e6381a731936c936f143a
Change-Id: I220f026134f3165037abad56fcccbd4cfc6ffc6b
1 file changed
tree: 04b7f096c209ae22893a9216c09a38f1d9740993
  1. git-hooks/
  2. infra/
  3. third_party/
  4. cts
  5. firmware
  6. flower
  7. jiri.lock
  8. minimal
  9. prebuilts
  10. README.md
  11. stem
  12. test_durations
  13. toolchain
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.