IDL4-CPP 1.0b2 FTF Avatar
  1. OMG Issue

IDL4CPP — The text in the C++ mapping document for bitmasks appears to contradict the text in the IDL4 specification.

  • Key: IDL4CPP-53
  • Status: closed  
  • Source: Objective Interface Systems ( Mr. Chuck Abbott)
  • Summary:

    The IDL 4 spec states the default bit_bound is 32 bits the C++ mapping document states:
    IDL bitmask declarations shall be mapped to two C++ type names:

    • An unscoped enum named <Bitmask>Bits with an explicitly defined underlying type. That underlying type
      is the smallest mapped unsigned integer type that has sufficient bits for the bit_bound of the bitmask:
      uint8_t, for values between 1 and 8; uint16_t for bit_bound values between 9 and 16; uint32_t, for
      values between 17 and 32; and uint64_t for values between 33 and 64. The <Bitmask>Bits enumerators
      are the values defined in the scope of the IDL bitmask, with each enumerator explicitly initialized to its
      corresponding integer value.
  • Reported: IDL4-CPP 1.0a1 — Fri, 1 Mar 2024 22:17 GMT
  • Disposition: Closed; No Change — IDL4-CPP 1.0b2
  • Disposition Summary:

    IDL4 specifies the default size for Bitmasks

    Clause 7.4.13.4.3.3 of IDL 4.2 states that "By default, the size of a bit mask is 32." Therefore, if @bit_bound is unspecified, we should assume the underlying type is uint32_t. It also states that "Two annotations can be used to amend a bit mask definition:" @bit_bound and @position. While an explicit @bit_bound would change the size of the bit mask, as stated in IDL 4.2, "Possible positions range from 0, which corresponds to the less significant bit, up to (size – 1), which corresponds to the most significant one." Because this specification specifies the mapping for all possible values of @bit_bound, there is no need to specify the underlying type for the default as it is 32 per IDL 4.2.

    Future versions of this specification or IDL RTFs may include further clarifications to facilitate the understanding of default behaviors.

  • Updated: Mon, 16 Sep 2024 14:15 GMT