diff options
| author | Fred Sundvik <fsundvik@gmail.com> | 2017-04-09 21:00:42 +0300 |
|---|---|---|
| committer | Fred Sundvik <fsundvik@gmail.com> | 2017-04-13 16:00:29 +0300 |
| commit | 653580477663f527f322650f6d39824cdf6cddc0 (patch) | |
| tree | 40d3d5a3fa6f15c8e6d7c47855a94e4ac79e0403 /quantum/keymap_common.c | |
| parent | a4ef86034c328ed7db9b9f0e2e49c5019d5aabc8 (diff) | |
| download | qmk_firmware-653580477663f527f322650f6d39824cdf6cddc0.tar.gz qmk_firmware-653580477663f527f322650f6d39824cdf6cddc0.zip | |
Disable array bounds warning in keymap_function_id_to_action
Diffstat (limited to 'quantum/keymap_common.c')
| -rw-r--r-- | quantum/keymap_common.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 6cf4f031f..9dafc8b51 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c | |||
| @@ -179,5 +179,12 @@ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) | |||
| 179 | __attribute__ ((weak)) | 179 | __attribute__ ((weak)) |
| 180 | uint16_t keymap_function_id_to_action( uint16_t function_id ) | 180 | uint16_t keymap_function_id_to_action( uint16_t function_id ) |
| 181 | { | 181 | { |
| 182 | // The compiler sees the empty (weak) fn_actions and generates a warning | ||
| 183 | // This function should not be called in that case, so the warning is too strict | ||
| 184 | // If this function is called however, the keymap should have overridden fn_actions, and then the compile | ||
| 185 | // is comparing against the wrong array | ||
| 186 | #pragma GCC diagnostic push | ||
| 187 | #pragma GCC diagnostic ignored "-Warray-bounds" | ||
| 182 | return pgm_read_word(&fn_actions[function_id]); | 188 | return pgm_read_word(&fn_actions[function_id]); |
| 189 | #pragma GCC diagnostic pop | ||
| 183 | } | 190 | } |
