lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] clang 10/C++20 build fixes


From: Vadim Zeitlin
Subject: [lmi] clang 10/C++20 build fixes
Date: Wed, 25 Mar 2020 16:22:58 +0100

 Hello,

 I've created several new PRs fixing lmi build with clang 10 including two
which are more general and apply to any C++20 compilers. They're, in no
particular order:

- https://github.com/vadz/lmi/pull/137 Always assume two's complement
  representation: in C++20 two's complement is the only allowed
  representation for the integer types and we've never used anything else
  in practice and there are no platforms using any other representation we
  could possibly want to target, so it seems sensible to just remove the
  test for two's complement representation and simply assume that it is
  indeed used, especially as it was already done in a test. Moreover, not
  doing it currently breaks clang compilation, so I hope this simple change
  can be applied to fix it. Incidentally, this PR also suppresses a warning
  which prevented bourn_cast unit test from compiling with clang.

- https://github.com/vadz/lmi/pull/139 Miscellaneous clang 10 fixes: this
  PR collects several other small changes that should be very quick to
  review and apply as they should be obviously correct. I really don't have
  much more to say about them than what I already wrote in the commit
  messages, but please let me know if you have any questions about them,
  of course.

- https://github.com/vadz/lmi/pull/140 Stop using std::bind{1st,2nd}()
  deprecated in C++17: this is the biggest change, although I still tried
  to keep it as small as possible. It is required by clang 10 but will be
  also almost certainly needed with gcc soon, as these functions are
  removed from C++17, after being deprecated since C++11. In practice, they
  were not removed from compilers with C++17 support, but, as clang 10
  shows, are being removed as C++20 support is being added, so I think this
  will happen in gcc too in the near future. This change tries to preserve
  the existing code as much as possible and just replaces these functions
  with the lambda functions equivalent to them. Several further possible
  improvements to this code are possible and could be discussed if there is
  any interest in them, but for now it would be great if this minimal
  possible change required to fix clang build could be applied.

 Thanks in advance for looking at these changes!
VZ

Attachment: pgph2IuLCmM5D.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]