Skip to content

Commit

Permalink
Merge bitcoin#31691: util: fix compiler warning about deprecated spac…
Browse files Browse the repository at this point in the history
…e before _MiB

d3339a7 util: fix compiler warning about deprecated space before _MiB (Vasil Dimov)

Pull request description:

  ```
  src/util/byte_units.h:13:29: error: identifier '_MiB' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]
     13 | constexpr size_t operator"" _MiB(unsigned long long mebibytes)
        |                  ~~~~~~~~~~~^~~~
        |                  operator""_MiB
  1 error generated.
  ```

  Clang 20.0.0

ACKs for top commit:
  maflcko:
    lgtm ACK d3339a7
  TheCharlatan:
    ACK d3339a7

Tree-SHA512: 534537eefae2b6a9cef1ba3aa9ef16c491c84c0e55fb827f4ea0bae7ab61a5cc266a71499a79da97a9e68953a2c7f9cd1864ddde41fda173c829ed2b7bd73a46
  • Loading branch information
fanquake committed Jan 20, 2025
2 parents 2e839dd + d3339a7 commit 4e52a63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/byte_units.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <stdexcept>

//! Overflow-safe conversion of MiB to bytes.
constexpr size_t operator"" _MiB(unsigned long long mebibytes)
constexpr size_t operator""_MiB(unsigned long long mebibytes)
{
auto bytes{CheckedLeftShift(mebibytes, 20)};
if (!bytes || *bytes > std::numeric_limits<size_t>::max()) {
Expand Down

0 comments on commit 4e52a63

Please sign in to comment.