X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Fkeymap_common.c;h=9dafc8b5165ff37c6d244c3ce872f6c03cf387d5;hb=3e7bb196124aeab8c84752501b7ec91915814735;hp=002eabd85e6e68edb7de9f7337fb7d5e57ffce8f;hpb=e34c3936b7db8f9d39f1eb0d0f4734fc37d7ebe3;p=qmk_firmware.git diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 002eabd85..9dafc8b51 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -1,5 +1,5 @@ /* -Copyright 2012,2013 Jun Wako +Copyright 2012-2017 Jun Wako This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -179,5 +179,12 @@ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) __attribute__ ((weak)) uint16_t keymap_function_id_to_action( uint16_t function_id ) { + // The compiler sees the empty (weak) fn_actions and generates a warning + // This function should not be called in that case, so the warning is too strict + // If this function is called however, the keymap should have overridden fn_actions, and then the compile + // is comparing against the wrong array + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Warray-bounds" return pgm_read_word(&fn_actions[function_id]); + #pragma GCC diagnostic pop }