From 41c91d42fe8f508a0e4dc96c9f612973828eee4c 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 50cf37c92238..2c329668f583 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)]; };