From d5c6bf28dae8e6e3c86a7c73c892b13ce84d48dd Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 12 Feb 2020 16:15:33 -0800 Subject: [PATCH] Fixed build warnings with gcc 7 in Layer_::getKeyFromPROGMEM(...) (by disabling the warning for this tiny bit of code) --- src/kaleidoscope/key_defs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/kaleidoscope/key_defs.h b/src/kaleidoscope/key_defs.h index 5585b87b..cca19bf3 100644 --- a/src/kaleidoscope/key_defs.h +++ b/src/kaleidoscope/key_defs.h @@ -48,6 +48,14 @@ class Key { void setFlags(uint8_t new_flags) { flags.value_ = new_flags; } + +// gcc 7 (Arduino > 1.8.10) has a problem with the layer dimension of +// keymap_linear, as used by keyFromKeymap(...) being undefined. +// Because of this, we disable -Warray_bounds locally to avoid spurious warnings. + + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" constexpr const uint8_t &getFlags() const { return flags.value_; } @@ -58,6 +66,8 @@ class Key { constexpr const uint8_t &getKeyCode() const { return keyCode.value_; } +#pragma GCC diagnostic pop + void setRaw(uint16_t raw) { flags.value_ = (uint8_t)(raw >> 8);