Open okke-formsma opened 3 years ago
Additional warnings pop up with display enabled
../../src/display/widgets/battery_status.c: In function 'set_battery_symbol':
../../src/display/widgets/battery_status.c:42:9: warning: '__builtin___strcpy_chk' writing 4 bytes into a region of size 2 overflows the destination [-Wstringop-overflow=]
42 | strcpy(text, LV_SYMBOL_CHARGE);
| ^~~~~~
../../src/display/widgets/battery_status.c:47:9: warning: '__builtin___strcat_chk' writing 4 bytes into a region of size 2 overflows the destination [-Wstringop-overflow=]
47 | strcat(text, LV_SYMBOL_BATTERY_FULL);
| ^~~~~~
../../src/display/widgets/battery_status.c:49:9: warning: '__builtin___strcat_chk' writing 4 bytes into a region of size 2 overflows the destination [-Wstringop-overflow=]
49 | strcat(text, LV_SYMBOL_BATTERY_3);
| ^~~~~~
../../src/display/widgets/battery_status.c:51:9: warning: '__builtin___strcat_chk' writing 4 bytes into a region of size 2 overflows the destination [-Wstringop-overflow=]
51 | strcat(text, LV_SYMBOL_BATTERY_2);
| ^~~~~~
../../src/display/widgets/battery_status.c:53:9: warning: '__builtin___strcat_chk' writing 4 bytes into a region of size 2 overflows the destination [-Wstringop-overflow=]
53 | strcat(text, LV_SYMBOL_BATTERY_1);
| ^~~~~~
../../src/display/widgets/battery_status.c:55:9: warning: '__builtin___strcat_chk' writing 4 bytes into a region of size 2 overflows the destination [-Wstringop-overflow=]
55 | strcat(text, LV_SYMBOL_BATTERY_EMPTY);
| ^~~~~~
[70/376] Building C object CMakeFiles/ap.../src/display/widgets/output_status.c.obj
In file included from /opt/zephyr-sdk-0.11.4/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:800,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_misc/lv_printf.h:62,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/lvgl.h:35,
from ../../include/zmk/display/widgets/output_status.h:9,
from ../../src/display/widgets/output_status.c:12:
../../src/display/widgets/output_status.c: In function 'set_status_symbol':
/workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/../lv_font/lv_symbol_def.h:69:35: warning: ' ' directive writing 4 bytes into a region of size between 0 and 2 [-Wformat-overflow=]
69 | #define LV_SYMBOL_WIFI "\xef\x87\xab" /*61931, 0xF1EB*/
| ^~~~~~~~~~~~~~
../../src/display/widgets/output_status.c:57:27: note: in expansion of macro 'LV_SYMBOL_WIFI'
57 | sprintf(text, LV_SYMBOL_WIFI "%i " LV_SYMBOL_SETTINGS, active_profile_index);
| ^~~~~~~~~~~~~~
In file included from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/../lv_font/lv_font.h:21,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/lv_style.h:17,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/lv_obj.h:20,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/lvgl.h:24,
from ../../include/zmk/display/widgets/output_status.h:9,
from ../../src/display/widgets/output_status.c:12:
/workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/../lv_font/lv_symbol_def.h:30:40: note: format string is defined here
30 | #define LV_SYMBOL_SETTINGS "\xef\x80\x93" /*61459, 0xF013*/
In file included from /opt/zephyr-sdk-0.11.4/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:800,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_misc/lv_printf.h:62,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/lvgl.h:35,
from ../../include/zmk/display/widgets/output_status.h:9,
from ../../src/display/widgets/output_status.c:12:
../../src/display/widgets/output_status.c:57:13: note: '__builtin___sprintf_chk' output between 9 and 11 bytes into a destination of size 6
57 | sprintf(text, LV_SYMBOL_WIFI "%i " LV_SYMBOL_SETTINGS, active_profile_index);
| ^~~~~~~
/workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/../lv_font/lv_symbol_def.h:69:35: warning: ' ' directive writing 4 bytes into a region of size between 0 and 2 [-Wformat-overflow=]
69 | #define LV_SYMBOL_WIFI "\xef\x87\xab" /*61931, 0xF1EB*/
| ^~~~~~~~~~~~~~
../../src/display/widgets/output_status.c:54:31: note: in expansion of macro 'LV_SYMBOL_WIFI'
54 | sprintf(text, LV_SYMBOL_WIFI "%i " LV_SYMBOL_CLOSE, active_profile_index);
| ^~~~~~~~~~~~~~
In file included from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/../lv_font/lv_font.h:21,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/lv_style.h:17,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/lv_obj.h:20,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/lvgl.h:24,
from ../../include/zmk/display/widgets/output_status.h:9,
from ../../src/display/widgets/output_status.c:12:
/workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/../lv_font/lv_symbol_def.h:30:40: note: format string is defined here
30 | #define LV_SYMBOL_SETTINGS "\xef\x80\x93" /*61459, 0xF013*/
In file included from /opt/zephyr-sdk-0.11.4/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:800,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_misc/lv_printf.h:62,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/lvgl.h:35,
from ../../include/zmk/display/widgets/output_status.h:9,
from ../../src/display/widgets/output_status.c:12:
../../src/display/widgets/output_status.c:54:17: note: '__builtin___sprintf_chk' output between 9 and 11 bytes into a destination of size 6
54 | sprintf(text, LV_SYMBOL_WIFI "%i " LV_SYMBOL_CLOSE, active_profile_index);
| ^~~~~~~
/workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/../lv_font/lv_symbol_def.h:69:35: warning: ' ' directive writing 4 bytes into a region of size between 0 and 2 [-Wformat-overflow=]
69 | #define LV_SYMBOL_WIFI "\xef\x87\xab" /*61931, 0xF1EB*/
| ^~~~~~~~~~~~~~
../../src/display/widgets/output_status.c:52:31: note: in expansion of macro 'LV_SYMBOL_WIFI'
52 | sprintf(text, LV_SYMBOL_WIFI "%i " LV_SYMBOL_OK, active_profile_index);
| ^~~~~~~~~~~~~~
In file included from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/../lv_font/lv_font.h:21,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/lv_style.h:17,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/lv_obj.h:20,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/lvgl.h:24,
from ../../include/zmk/display/widgets/output_status.h:9,
from ../../src/display/widgets/output_status.c:12:
/workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/../lv_font/lv_symbol_def.h:30:40: note: format string is defined here
30 | #define LV_SYMBOL_SETTINGS "\xef\x80\x93" /*61459, 0xF013*/
In file included from /opt/zephyr-sdk-0.11.4/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:800,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_misc/lv_printf.h:62,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/lvgl.h:35,
from ../../include/zmk/display/widgets/output_status.h:9,
from ../../src/display/widgets/output_status.c:12:
../../src/display/widgets/output_status.c:52:17: note: '__builtin___sprintf_chk' output between 9 and 11 bytes into a destination of size 6
52 | sprintf(text, LV_SYMBOL_WIFI "%i " LV_SYMBOL_OK, active_profile_index);
| ^~~~~~~
In file included from /opt/zephyr-sdk-0.11.4/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/string.h:180,
from /workspaces/zmk-artsey/zephyr/include/logging/log_msg.h:11,
from /workspaces/zmk-artsey/zephyr/include/logging/log_core.h:9,
from /workspaces/zmk-artsey/zephyr/include/logging/log.h:11,
from ../../src/display/widgets/output_status.c:9:
../../src/display/widgets/output_status.c:47:9: warning: '__builtin___strcat_chk' writing 7 bytes into a region of size 6 overflows the destination [-Wstringop-overflow=]
47 | strcat(text, LV_SYMBOL_USB " ");
| ^~~~~~
[71/376] Building C object CMakeFiles/ap...r/src/display/widgets/layer_status.c.obj
In file included from /opt/zephyr-sdk-0.11.4/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:800,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_misc/lv_printf.h:62,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/lvgl.h:35,
from ../../include/zmk/display/widgets/layer_status.h:9,
from ../../src/display/widgets/layer_status.c:10:
../../src/display/widgets/layer_status.c: In function 'set_layer_symbol':
/workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_core/../lv_font/lv_symbol_def.h:66:35: warning: '__builtin___sprintf_chk' may write a terminating nul past the end of the destination [-Wformat-overflow=]
66 | #define LV_SYMBOL_KEYBOARD "\xef\x84\x9c" /*61724, 0xF11C*/
| ^~~~~~~~~~~~~~
../../src/display/widgets/layer_status.c:43:23: note: in expansion of macro 'LV_SYMBOL_KEYBOARD'
43 | sprintf(text, LV_SYMBOL_KEYBOARD "%i", active_layer_index);
| ^~~~~~~~~~~~~~~~~~
../../src/display/widgets/layer_status.c:49:50: note: format string is defined here
49 | snprintf(text, 12, LV_SYMBOL_KEYBOARD "%s", layer_label);
| ^
In file included from /opt/zephyr-sdk-0.11.4/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:800,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/src/lv_misc/lv_printf.h:62,
from /workspaces/zmk-artsey/modules/lib/gui/lvgl/lvgl.h:35,
from ../../include/zmk/display/widgets/layer_status.h:9,
from ../../src/display/widgets/layer_status.c:10:
../../src/display/widgets/layer_status.c:43:9: note: '__builtin___sprintf_chk' output between 5 and 7 bytes into a destination of size 6
43 | sprintf(text, LV_SYMBOL_KEYBOARD "%i", active_layer_index);
| ^~~~~~~
[371/376] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region Used Size Region Size %age Used
FLASH: 284352 B 792 KB 35.06%
SRAM: 58269 B 256 KB 22.23%
IDT_LIST: 168 B 2 KB 8.20%
[376/376] Linking C executable zephyr/zmk.elf
Converted to uf2, output size: 568832, start address: 0x26000
Wrote 568832 bytes to /workspaces/zmk-artsey/app/build/the_paintbrush_left/zephyr/zmk.uf2
it appears that even just increasing the size of the text fields won't produce a functional build ; something deeper is broken with display and the updated libc
After enabling
CONFIG_NEWLIB_LIBC
, I got the following warnings: