From 0c5e36d0560f2097b34ce2f1ea19e64a13da5f55 Mon Sep 17 00:00:00 2001 From: Scott Lamb Date: Tue, 28 Apr 2026 11:31:00 -0700 Subject: [PATCH] Fix `make test:all` failures seen on macOS Tahoe (#26136) --- builddefs/common_rules.mk | 6 +++++- docs/features/unicode.md | 2 +- .../drivers/eeprom/eeprom_legacy_emulated_flash.c | 4 +++- platforms/test/drivers/audio_pwm_hardware.c | 4 ++-- platforms/timer.c | 6 +++++- quantum/encoder/tests/encoder_tests.cpp | 4 ++-- .../tests/encoder_tests_split_left_eq_right.cpp | 4 ++-- .../tests/encoder_tests_split_left_gt_right.cpp | 4 ++-- .../tests/encoder_tests_split_left_lt_right.cpp | 4 ++-- .../encoder/tests/encoder_tests_split_no_left.cpp | 4 ++-- .../encoder/tests/encoder_tests_split_no_right.cpp | 4 ++-- quantum/process_keycode/process_key_override.c | 2 +- quantum/process_keycode/process_space_cadet.c | 2 +- quantum/unicode/unicode.c | 12 +++--------- tests/test_common/keyboard_report_util.hpp | 2 +- tmk_core/protocol/usb_device_state.c | 2 +- 16 files changed, 35 insertions(+), 31 deletions(-) diff --git a/builddefs/common_rules.mk b/builddefs/common_rules.mk index fb03d9e3627..d8e0bf0220e 100644 --- a/builddefs/common_rules.mk +++ b/builddefs/common_rules.mk @@ -52,8 +52,12 @@ ifeq ($(strip $(DEBUG_ENABLE)),yes) ASFLAGS += -ggdb3 endif -# Always create a map file to see what was compiled and where. +# Create a map file to see what was compiled and where, unless disabled +# (e.g. test builds, which use the host linker — Apple's ld does not accept +# -Map=/--cref). +ifneq ($(strip $(CREATE_MAP)), no) LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref +endif #---------------- C Compiler Options ---------------- diff --git a/docs/features/unicode.md b/docs/features/unicode.md index 7ed178c30d7..feea479492a 100644 --- a/docs/features/unicode.md +++ b/docs/features/unicode.md @@ -25,7 +25,7 @@ Add the following to your `config.h`: |`UNICODE_KEY_MAC` |`KC_LEFT_ALT` |The key to hold when beginning a Unicode sequence with the macOS input mode | |`UNICODE_KEY_LNX` |`LCTL(LSFT(KC_U))`|The key to tap when beginning a Unicode sequence with the Linux input mode | |`UNICODE_KEY_WINC` |`KC_RIGHT_ALT` |The key to hold when beginning a Unicode sequence with the WinCompose input mode| -|`UNICODE_SELECTED_MODES`|`-1` |A comma separated list of input modes for cycling through | +|`UNICODE_SELECTED_MODES`|*n/a* |A comma separated list of input modes for cycling through | |`UNICODE_CYCLE_PERSIST` |`true` |Whether to persist the current Unicode input mode to EEPROM | |`UNICODE_TYPE_DELAY` |`10` |The amount of time to wait, in milliseconds, between Unicode sequence keystrokes| diff --git a/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c b/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c index cf6b85fd128..737804b59fb 100644 --- a/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c +++ b/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c @@ -204,7 +204,9 @@ void print_eeprom(void) { } xprintf("%04x", i); } - if (i % 8 == 0) print(" "); + if (i % 8 == 0) { + print(" "); + } xprintf(" %02x", DataBuf[i]); if ((i + 1) % 16 == 0) { diff --git a/platforms/test/drivers/audio_pwm_hardware.c b/platforms/test/drivers/audio_pwm_hardware.c index 3a0384117a4..dc3b0ff3da7 100644 --- a/platforms/test/drivers/audio_pwm_hardware.c +++ b/platforms/test/drivers/audio_pwm_hardware.c @@ -16,5 +16,5 @@ #include "audio.h" void audio_driver_initialize_impl(void) {} -void audio_driver_start_impl() {} -void audio_driver_stop_impl() {} +void audio_driver_start_impl(void) {} +void audio_driver_stop_impl(void) {} diff --git a/platforms/timer.c b/platforms/timer.c index ba2cf94d2bf..2f534f3f1dd 100644 --- a/platforms/timer.c +++ b/platforms/timer.c @@ -1,7 +1,11 @@ // Copyright 2023 Sergey Vlasov (@sigprof) // SPDX-License-Identifier: GPL-2.0-or-later -#include "timer.h" +// Use an angle-bracket include so the header is located via the include +// search path rather than source-relative lookup. timer.h uses +// #include_next to chain to the active platform's _timer.h, and that +// only has well-defined semantics when timer.h itself was found via -I. +#include // Generate out-of-line copies for inline functions defined in timer.h. extern inline fast_timer_t timer_read_fast(void); diff --git a/quantum/encoder/tests/encoder_tests.cpp b/quantum/encoder/tests/encoder_tests.cpp index 499e413aed4..10ae9139d92 100644 --- a/quantum/encoder/tests/encoder_tests.cpp +++ b/quantum/encoder/tests/encoder_tests.cpp @@ -26,8 +26,8 @@ extern "C" { } struct update { - int8_t index; - bool clockwise; + uint8_t index; + bool clockwise; }; uint8_t updates_array_idx = 0; diff --git a/quantum/encoder/tests/encoder_tests_split_left_eq_right.cpp b/quantum/encoder/tests/encoder_tests_split_left_eq_right.cpp index 590bd2e9f43..4665e556149 100644 --- a/quantum/encoder/tests/encoder_tests_split_left_eq_right.cpp +++ b/quantum/encoder/tests/encoder_tests_split_left_eq_right.cpp @@ -26,8 +26,8 @@ extern "C" { } struct update { - int8_t index; - bool clockwise; + uint8_t index; + bool clockwise; }; uint8_t updates_array_idx = 0; diff --git a/quantum/encoder/tests/encoder_tests_split_left_gt_right.cpp b/quantum/encoder/tests/encoder_tests_split_left_gt_right.cpp index e6f4db2636d..49af6892264 100644 --- a/quantum/encoder/tests/encoder_tests_split_left_gt_right.cpp +++ b/quantum/encoder/tests/encoder_tests_split_left_gt_right.cpp @@ -26,8 +26,8 @@ extern "C" { } struct update { - int8_t index; - bool clockwise; + uint8_t index; + bool clockwise; }; uint8_t updates_array_idx = 0; diff --git a/quantum/encoder/tests/encoder_tests_split_left_lt_right.cpp b/quantum/encoder/tests/encoder_tests_split_left_lt_right.cpp index c155f1269ab..9df795b8373 100644 --- a/quantum/encoder/tests/encoder_tests_split_left_lt_right.cpp +++ b/quantum/encoder/tests/encoder_tests_split_left_lt_right.cpp @@ -26,8 +26,8 @@ extern "C" { } struct update { - int8_t index; - bool clockwise; + uint8_t index; + bool clockwise; }; uint8_t updates_array_idx = 0; diff --git a/quantum/encoder/tests/encoder_tests_split_no_left.cpp b/quantum/encoder/tests/encoder_tests_split_no_left.cpp index 75244b94a27..17ae1bef2bc 100644 --- a/quantum/encoder/tests/encoder_tests_split_no_left.cpp +++ b/quantum/encoder/tests/encoder_tests_split_no_left.cpp @@ -26,8 +26,8 @@ extern "C" { } struct update { - int8_t index; - bool clockwise; + uint8_t index; + bool clockwise; }; uint8_t updates_array_idx = 0; diff --git a/quantum/encoder/tests/encoder_tests_split_no_right.cpp b/quantum/encoder/tests/encoder_tests_split_no_right.cpp index bde6e1c29dd..cf340b7cdcd 100644 --- a/quantum/encoder/tests/encoder_tests_split_no_right.cpp +++ b/quantum/encoder/tests/encoder_tests_split_no_right.cpp @@ -26,8 +26,8 @@ extern "C" { } struct update { - int8_t index; - bool clockwise; + uint8_t index; + bool clockwise; }; uint8_t updates_array_idx = 0; diff --git a/quantum/process_keycode/process_key_override.c b/quantum/process_keycode/process_key_override.c index b6ef636e15b..8e241491452 100644 --- a/quantum/process_keycode/process_key_override.c +++ b/quantum/process_keycode/process_key_override.c @@ -175,7 +175,7 @@ const key_override_t *clear_active_override(const bool allow_reregister) { const key_override_t *const old = active_override; - const uint8_t mod_free_replacement = clear_mods_from(active_override->replacement); + const uint16_t mod_free_replacement = clear_mods_from(active_override->replacement); bool unregister_replacement = mod_free_replacement != KC_NO && // KC_NO is never registered mod_free_replacement < SAFE_RANGE; // Custom keycodes are never registered diff --git a/quantum/process_keycode/process_space_cadet.c b/quantum/process_keycode/process_space_cadet.c index 3e280d57d97..f3a85785dff 100644 --- a/quantum/process_keycode/process_space_cadet.c +++ b/quantum/process_keycode/process_space_cadet.c @@ -165,6 +165,6 @@ bool process_space_cadet(uint16_t keycode, keyrecord_t *record) { return true; } -void reset_space_cadet() { +void reset_space_cadet(void) { sc_last = 0; } diff --git a/quantum/unicode/unicode.c b/quantum/unicode/unicode.c index dff1d43fb41..b84c130907e 100644 --- a/quantum/unicode/unicode.c +++ b/quantum/unicode/unicode.c @@ -46,12 +46,6 @@ # define UNICODE_KEY_WINC KC_RIGHT_ALT #endif -// Comma-delimited, ordered list of input modes selected for use (e.g. in cycle) -// Example: #define UNICODE_SELECTED_MODES UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_LINUX -#ifndef UNICODE_SELECTED_MODES -# define UNICODE_SELECTED_MODES -1 -#endif - // Whether input mode changes in cycle should be written to EEPROM #ifndef UNICODE_CYCLE_PERSIST # define UNICODE_CYCLE_PERSIST true @@ -66,7 +60,7 @@ unicode_config_t unicode_config; uint8_t unicode_saved_mods; led_t unicode_saved_led_state; -#if UNICODE_SELECTED_MODES != -1 +#ifdef UNICODE_SELECTED_MODES static uint8_t selected[] = {UNICODE_SELECTED_MODES}; static int8_t selected_count = ARRAY_SIZE(selected); static int8_t selected_index; @@ -136,7 +130,7 @@ static void unicode_play_song(uint8_t mode) { void unicode_input_mode_init(void) { eeconfig_read_unicode_mode(&unicode_config); -#if UNICODE_SELECTED_MODES != -1 +#ifdef UNICODE_SELECTED_MODES # if UNICODE_CYCLE_PERSIST // Find input_mode in selected modes int8_t i; @@ -178,7 +172,7 @@ void set_unicode_input_mode(uint8_t mode) { } static void cycle_unicode_input_mode(int8_t offset) { -#if UNICODE_SELECTED_MODES != -1 +#ifdef UNICODE_SELECTED_MODES selected_index = (selected_index + offset) % selected_count; if (selected_index < 0) { selected_index += selected_count; diff --git a/tests/test_common/keyboard_report_util.hpp b/tests/test_common/keyboard_report_util.hpp index 8a7d716869c..666791a5b61 100644 --- a/tests/test_common/keyboard_report_util.hpp +++ b/tests/test_common/keyboard_report_util.hpp @@ -35,5 +35,5 @@ class KeyboardReportMatcher : public testing::MatcherInterface inline testing::Matcher KeyboardReport(Ts... keys) { - return testing::MakeMatcher(new KeyboardReportMatcher(std::vector({keys...}))); + return testing::MakeMatcher(new KeyboardReportMatcher({static_cast(keys)...})); } diff --git a/tmk_core/protocol/usb_device_state.c b/tmk_core/protocol/usb_device_state.c index 98ccfbc9027..46f83b43251 100644 --- a/tmk_core/protocol/usb_device_state.c +++ b/tmk_core/protocol/usb_device_state.c @@ -78,7 +78,7 @@ void usb_device_state_set_protocol(usb_hid_protocol_t protocol) { notify_usb_device_state_change(usb_device_state); } -inline usb_hid_protocol_t usb_device_state_get_protocol() { +inline usb_hid_protocol_t usb_device_state_get_protocol(void) { return usb_device_state.protocol; }