Skip to content

[Bug] uprintf calls removed during pre-processing phase despite USER_PRINT #24987

Open
@precondition

Description

@precondition

Describe the Bug

It seems like between commit 0115951 and 6a73c82, defining USER_PRINT deletes all uprintf calls during the pre-processing phase

As far as I can tell from the (possibly outdated) docs, the expected behavior should not have changed:

docs/getting_started_make_guide.md
78:To disable print messages (*print*, *xprintf*) and **KEEP** user print messages (*uprint*), include `#define USER_PRINT` in your `config.h` file (do not also include `#define NO_PRINT` in this case).

Reverting commit bb71145 "Tidy up print/debug logging headers (#22969)" restores previous behavior

For reference, I tested with #define USER_PRINT in config.h (notably without defining #define NO_PRINT) and using uprintf in this way:

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef CONSOLE_ENABLE
    const bool is_combo = record->event.type == COMBO_EVENT;
    uprintf("0x%04X\t%u\t%u\t0x%X\t%u\t0x%02X\t0x%02X\t%u\n",
         keycode,
         is_combo ? 254 : record->event.key.row,
         is_combo ? 254 : record->event.key.col,
         layer_state|default_layer_state,
         record->event.pressed,
         get_mods(),
         get_oneshot_mods(),
         record->tap.count
         );
#endif

(I noticed that uprintf was getting removed during preprocessing because the compiler was complaining that is_combo is unused)

Keyboard Used

handwired/dactyl_manuform/5x6

Link to product page (if applicable)

No response

Operating System

Linux (Xubuntu)

qmk doctor Output

Ψ QMK Doctor is checking your environment.
Ψ CLI version: 1.1.1
Ψ QMK home: /home/vern/qmk_firmware
Ψ Detected Linux (Ubuntu 22.04 LTS).
⚠ Found old, deprecated udev rules for 'atmel-dfu' boards. The new rules on https://docs.qmk.fm/#/faq_build?id=linux-udev-rules offer better security with the same functionality.
⚠ Found old, deprecated udev rules for 'kiibohd' boards. The new rules on https://docs.qmk.fm/#/faq_build?id=linux-udev-rules offer better security with the same functionality.
⚠ Missing or outdated udev rules for 'stm32-dfu' boards. Run 'sudo cp /home/vern/qmk_firmware/util/udev/50-qmk.rules /etc/udev/rules.d/'.
⚠ Missing or outdated udev rules for 'apm32-dfu' boards. Run 'sudo cp /home/vern/qmk_firmware/util/udev/50-qmk.rules /etc/udev/rules.d/'.
⚠ Missing or outdated udev rules for 'gd32v-dfu' boards. Run 'sudo cp /home/vern/qmk_firmware/util/udev/50-qmk.rules /etc/udev/rules.d/'.
⚠ Missing or outdated udev rules for 'wb32-dfu' boards. Run 'sudo cp /home/vern/qmk_firmware/util/udev/50-qmk.rules /etc/udev/rules.d/'.
⚠ Missing or outdated udev rules for 'at32-dfu' boards. Run 'sudo cp /home/vern/qmk_firmware/util/udev/50-qmk.rules /etc/udev/rules.d/'.
⚠ Found old, deprecated udev rules for 'bootloadhid' boards. The new rules on https://docs.qmk.fm/#/faq_build?id=linux-udev-rules offer better security with the same functionality.
⚠ Missing or outdated udev rules for 'usbasploader' boards. Run 'sudo cp /home/vern/qmk_firmware/util/udev/50-qmk.rules /etc/udev/rules.d/'.
⚠ Missing or outdated udev rules for 'usbtinyisp' boards. Run 'sudo cp /home/vern/qmk_firmware/util/udev/50-qmk.rules /etc/udev/rules.d/'.
⚠ Missing or outdated udev rules for 'md-boot' boards. Run 'sudo cp /home/vern/qmk_firmware/util/udev/50-qmk.rules /etc/udev/rules.d/'.
⚠ Found old, deprecated udev rules for 'caterina' boards. The new rules on https://docs.qmk.fm/#/faq_build?id=linux-udev-rules offer better security with the same functionality.
⚠ Missing or outdated udev rules for 'hid-bootloader' boards. Run 'sudo cp /home/vern/qmk_firmware/util/udev/50-qmk.rules /etc/udev/rules.d/'.
Ψ Userspace enabled: False
Ψ Git branch: master
Ψ Repo version: 0.28.0
Ψ - Latest master: 2025-03-04 03:22:37 +0800 (f0a5db96c8) -- Add keyboard Cloak (#24858)
Ψ - Latest upstream/master: 2025-03-04 03:22:37 +0800 (f0a5db96c8) -- Add keyboard Cloak (#24858)
Ψ - Latest upstream/develop: 2025-03-03 19:23:41 +0000 (4d3a9ce13a) -- Merge remote-tracking branch 'origin/master' into develop
Ψ - Common ancestor with upstream/master: 2025-03-04 03:22:37 +0800 (f0a5db96c8) -- Add keyboard Cloak (#24858)
Ψ - Common ancestor with upstream/develop: 2025-03-04 03:22:37 +0800 (f0a5db96c8) -- Add keyboard Cloak (#24858)
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 10.3.1
Ψ Successfully compiled using arm-none-eabi-gcc
Ψ Successfully tested arm-none-eabi-binutils using arm-none-eabi-size
Ψ Found avr-gcc version 5.4.0
Ψ Successfully compiled using avr-gcc
Ψ Successfully tested avr-binutils using avr-size
Ψ Found avrdude version 6.3-20171130
Ψ Found dfu-programmer version 0.6.1
Ψ Found dfu-util version 0.9
Ψ Submodules are up to date.
Ψ Submodule status:
Ψ - lib/chibios: 2024-12-15 07:44:56 +0000 --  (2365f84429)
Ψ - lib/chibios-contrib: 2025-01-08 21:03:31 +0100 --  (3ac181e4)
Ψ - lib/googletest: 2021-06-11 06:37:43 -0700 --  (e2239ee6)
Ψ - lib/lufa: 2022-08-26 12:09:55 +1000 --  (549b97320)
Ψ - lib/vusb: 2022-06-13 09:18:17 +1000 --  (819dbc1)
Ψ - lib/printf: 2022-06-29 23:59:58 +0300 --  (c2e3b4e)
Ψ - lib/pico-sdk: 2023-02-12 20:19:37 +0100 --  (a3398d8)
Ψ - lib/lvgl: 2022-04-11 04:44:53 -0600 --  (e19410f8)
Ψ QMK is ready to go, but minor problems were found

Is AutoHotKey / Karabiner installed

  • AutoHotKey (Windows)
  • Karabiner (macOS)

Other keyboard-related software installed

No response

Additional Context

I reported this issue for the first time in 2024/10/03 on Discord (https://discord.com/channels/440868230475677696/867530715192885269/1291486058068049944).

At the time, zvecr said he might look into it but, in the end, I don't know if he did it or not.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions