qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
18.24k stars 39.32k forks source link

[Bug] Swap hands matrix has wrong dimensions for Planck rev6 #17388

Closed jenspets closed 2 years ago

jenspets commented 2 years ago

When enabling swap hands for planck/rev6 and planck/rev6_drop, the code does not compile.

Describe the Bug

The matrix dimensions for the variable hand_swap_config is wrong for planck/rev6 and planck/rev6_drop.

It can be recreated by adding SWAP_HANDS_ENABLE = yes to keyboards/planck/keymaps/default/rules.mk and compile the firmware using make planck/rev6:default

output is as follows:

$ make planck/rev6:default
QMK Firmware 0.15.11
Making planck/rev6 with keymap default

arm-none-eabi-gcc (15:10.3-2021.07-4) 10.3.1 20210621 (release)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiling: keyboards/planck/planck.c                                                               keyboards/planck/planck.c:20:56: error: excess elements in array initializer [-Werror]
   20 |     {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
      |                                                        ^
keyboards/planck/planck.c:20:56: note: (near initialization for 'hand_swap_config[0]')
keyboards/planck/planck.c:20:64: error: excess elements in array initializer [-Werror]
   20 |     {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
      |                                                                ^
keyboards/planck/planck.c:20:64: note: (near initialization for 'hand_swap_config[0]')
keyboards/planck/planck.c:20:72: error: excess elements in array initializer [-Werror]
   20 |     {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
      |                                                                        ^
[...]
keyboards/planck/planck.c:23:96: note: (near initialization for 'hand_swap_config[3]')
cc1: all warnings being treated as errors
 [ERRORS]
 | 
 | 
 | 
make[1]: *** [builddefs/common_rules.mk:456: .build/obj_planck_rev6_default/keyboards/planck/planck.o] Error 1
Make finished with errors
make: *** [Makefile:413: planck/rev6:default] Error 1

System Information

Keyboard: Planck Revision (if applicable): rev6 and rev6_drop Operating system: Linux qmk doctor output:

Ψ QMK Doctor is checking your environment.
Ψ CLI version: 1.1.0
Ψ QMK home: /home/jenspets/source/qmk_firmware
Ψ Detected Linux.
Ψ Git branch: planck_sh_matrix
Ψ Repo version: 0.15.11
⚠ Git has unstashed/uncommitted changes.
Ψ CLI installed in virtualenv.
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 10.3.1
Ψ Found avr-gcc version 5.4.0
Ψ Found avrdude version 6.3-20171130
Ψ Found dfu-util version 0.9
Ψ Found dfu-programmer version 0.6.1
Ψ Submodules are up to date.
Ψ QMK is ready to go, but minor problems were found

Any keyboard related software installed?

Additional Context

drashna commented 2 years ago

This appears to have been fixed.