Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: build errors #12

Closed
wants to merge 1 commit into from

Conversation

elisiano
Copy link
Contributor

@elisiano elisiano commented Dec 4, 2022

Currently when building I receive the following errors:

❯ make draculad:manna-harbour_miryoku MIRYOKU_CLIPBOARD=MAC
Making draculad with keymap manna-harbour_miryoku

avr-gcc (Homebrew AVR GCC 8.5.0) 8.5.0
Copyright (C) 2018 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.

Generating: .build/obj_draculad/src/info_config.h                                                   [OK]
Generating: .build/obj_draculad/src/default_keyboard.c                                              [OK]
Generating: .build/obj_draculad/src/default_keyboard.h                                              [OK]
Compiling: keyboards/draculad/draculad.c                                                            [OK]
Compiling: .build/obj_draculad/src/default_keyboard.c                                               [OK]
Compiling: quantum/keymap_introspection.c                                                          In file included from quantum/keymap_introspection.c:9:
users/manna-harbour_miryoku/manna-harbour_miryoku.c: In function 'u_td_fn_U_SYM':
users/manna-harbour_miryoku/manna-harbour_miryoku.c:29:23: error: unsigned conversion from 'int' to 'layer_state_t' {aka 'unsigned char'} changes value from '256' to '0' [-Werror=overflow]
     default_layer_set((layer_state_t)1 << U_##LAYER); \
                       ^~~~~~~~~~~~~~~~~~~~~~
users/manna-harbour_miryoku/miryoku_babel/miryoku_layer_list.h:20:1: note: in expansion of macro 'MIRYOKU_X'
 MIRYOKU_X(SYM,    "Sym") \
 ^~~~~~~~~
users/manna-harbour_miryoku/manna-harbour_miryoku.c:32:1: note: in expansion of macro 'MIRYOKU_LAYER_LIST'
 MIRYOKU_LAYER_LIST
 ^~~~~~~~~~~~~~~~~~
users/manna-harbour_miryoku/manna-harbour_miryoku.c: In function 'u_td_fn_U_FUN':
users/manna-harbour_miryoku/manna-harbour_miryoku.c:29:23: error: unsigned conversion from 'int' to 'layer_state_t' {aka 'unsigned char'} changes value from '512' to '0' [-Werror=overflow]
     default_layer_set((layer_state_t)1 << U_##LAYER); \
                       ^~~~~~~~~~~~~~~~~~~~~~
users/manna-harbour_miryoku/miryoku_babel/miryoku_layer_list.h:21:1: note: in expansion of macro 'MIRYOKU_X'
 MIRYOKU_X(FUN,    "Fun")
 ^~~~~~~~~
users/manna-harbour_miryoku/manna-harbour_miryoku.c:32:1: note: in expansion of macro 'MIRYOKU_LAYER_LIST'
 MIRYOKU_LAYER_LIST
 ^~~~~~~~~~~~~~~~~~
quantum/keymap_introspection.c: At top level:
quantum/keymap_introspection.c:20:1: error: static assertion failed: "Number of keymap layers exceeds maximum set by LAYER_STATE_(8|16|32)BIT"
 _Static_assert(NUM_KEYMAP_LAYERS <= MAX_LAYER, "Number of keymap layers exceeds maximum set by LAYER_STATE_(8|16|32)BIT");
 ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
 [ERRORS]
 |
 |
 |
make[1]: *** [.build/obj_draculad_manna-harbour_miryoku/quantum/keymap_introspection.o] Error 1
make: *** [draculad:manna-harbour_miryoku] Error 1
Make finished with errors

The assertion was introduced recently(ish) so I just commented that out.

For the type casting errors I just added a surrounding parenthesis to the shifted value.

I am not sure if this is the correct way to fix this, but it prevents the build errors for now.

Currently when building I receive the following errors:
```bash
❯ make draculad:manna-harbour_miryoku MIRYOKU_CLIPBOARD=MAC
Making draculad with keymap manna-harbour_miryoku

avr-gcc (Homebrew AVR GCC 8.5.0) 8.5.0
Copyright (C) 2018 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.

Generating: .build/obj_draculad/src/info_config.h                                                   [OK]
Generating: .build/obj_draculad/src/default_keyboard.c                                              [OK]
Generating: .build/obj_draculad/src/default_keyboard.h                                              [OK]
Compiling: keyboards/draculad/draculad.c                                                            [OK]
Compiling: .build/obj_draculad/src/default_keyboard.c                                               [OK]
Compiling: quantum/keymap_introspection.c                                                          In file included from quantum/keymap_introspection.c:9:
users/manna-harbour_miryoku/manna-harbour_miryoku.c: In function 'u_td_fn_U_SYM':
users/manna-harbour_miryoku/manna-harbour_miryoku.c:29:23: error: unsigned conversion from 'int' to 'layer_state_t' {aka 'unsigned char'} changes value from '256' to '0' [-Werror=overflow]
     default_layer_set((layer_state_t)1 << U_##LAYER); \
                       ^~~~~~~~~~~~~~~~~~~~~~
users/manna-harbour_miryoku/miryoku_babel/miryoku_layer_list.h:20:1: note: in expansion of macro 'MIRYOKU_X'
 MIRYOKU_X(SYM,    "Sym") \
 ^~~~~~~~~
users/manna-harbour_miryoku/manna-harbour_miryoku.c:32:1: note: in expansion of macro 'MIRYOKU_LAYER_LIST'
 MIRYOKU_LAYER_LIST
 ^~~~~~~~~~~~~~~~~~
users/manna-harbour_miryoku/manna-harbour_miryoku.c: In function 'u_td_fn_U_FUN':
users/manna-harbour_miryoku/manna-harbour_miryoku.c:29:23: error: unsigned conversion from 'int' to 'layer_state_t' {aka 'unsigned char'} changes value from '512' to '0' [-Werror=overflow]
     default_layer_set((layer_state_t)1 << U_##LAYER); \
                       ^~~~~~~~~~~~~~~~~~~~~~
users/manna-harbour_miryoku/miryoku_babel/miryoku_layer_list.h:21:1: note: in expansion of macro 'MIRYOKU_X'
 MIRYOKU_X(FUN,    "Fun")
 ^~~~~~~~~
users/manna-harbour_miryoku/manna-harbour_miryoku.c:32:1: note: in expansion of macro 'MIRYOKU_LAYER_LIST'
 MIRYOKU_LAYER_LIST
 ^~~~~~~~~~~~~~~~~~
quantum/keymap_introspection.c: At top level:
quantum/keymap_introspection.c:20:1: error: static assertion failed: "Number of keymap layers exceeds maximum set by LAYER_STATE_(8|16|32)BIT"
 _Static_assert(NUM_KEYMAP_LAYERS <= MAX_LAYER, "Number of keymap layers exceeds maximum set by LAYER_STATE_(8|16|32)BIT");
 ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
 [ERRORS]
 |
 |
 |
make[1]: *** [.build/obj_draculad_manna-harbour_miryoku/quantum/keymap_introspection.o] Error 1
make: *** [draculad:manna-harbour_miryoku] Error 1
Make finished with errors
```

The assertion was introduced recently(ish) so I just commented that out.

For the type casting errors I just added a surrounding parenthesis to the shifted value.

I am not sure if this is the correct way to fix this, but it prevents the build errors for now.
@manna-harbour
Copy link
Owner

The problem with building for draculad is this line: https://github.com/qmk/qmk_firmware/blob/92354b2ca876b6b5dbcb5d34aa34fda6a473bb1a/keyboards/draculad/config.h#L61. It should be removed, or moved to keyboards/draculad/keymaps/default/config.h.

You might like to submit a PR upstream to QMK to fix it. Draculad is maintained by @MangoIV, but this line was added in qmk/qmk_firmware#11930 by @tzarc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants