Piotr Tworek 27b798fa4f base: Make int to access_t conversion explicit.
As far as I can tell this is not raised by any released GCC versions.
Clang 13 on the other hand warns about it due to implicit-int-conversion
warning which is automatically enabled together with Wconversion. The
problem is relatively simple, shifting access_t value does not always
produce result which is also of access_t type. For example, if access_t
is uint16_t, shifting it will produce integer result. This can be
observed even with GCC. Building the following C++ example will fail:

  #include <type_traits>
  #include <stdint.h>

  int test() {
      uint16_t a = 0xabcd;
      static_assert(std::is_same_v<decltype(a<<1), uint16_t>);
      return 0;
  }

Changing uint16_t in the static_assert to int, will allow the code to
build.

Make such int to access_t implicit conversion explicit to allow the code
to be compiled with both GCC and clang.

Issue #4354
2022-01-19 12:35:48 +01:00
..
2021-12-17 15:04:44 +01:00
2021-05-28 14:16:45 +02:00
2021-11-29 15:10:52 +01:00
2019-02-19 11:12:11 +01:00
2021-01-25 13:58:10 +01:00
2021-12-17 15:04:44 +01:00
2017-03-15 12:32:24 +01:00
2021-12-17 15:04:44 +01:00
2021-12-17 15:04:44 +01:00
2020-08-25 11:50:10 +02:00