From ae3ea156eae35e8a6e010a73229de1b128466582 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 14 Jan 2020 08:50:17 -0700 Subject: [PATCH] Fix for older versions of intel compiler The intel-17 and intel-18 compilers seem to require that `u` be `const`: ``` /src/fmt/format.h(226): warning #437: reference to local variable of enclosing function is not allowed char data[sizeof(u)]; ``` If `u` is declared as `const auto u =1u` instead of just `auto u=1u`, the file compiles with no warnings. --- include/fmt/format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index af57862b..38626caf 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -235,7 +235,7 @@ inline Dest bit_cast(const Source& source) { } inline bool is_big_endian() { - auto u = 1u; + const auto u = 1u; struct bytes { char data[sizeof(u)]; };