Skip to content

ACE: Build failure due to format specifier mismatch (unsigned short vs int) #89008

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

Open
gbarkadiusz opened this issue Apr 24, 2025 · 0 comments · May be fixed by #89057
Open

ACE: Build failure due to format specifier mismatch (unsigned short vs int) #89008

gbarkadiusz opened this issue Apr 24, 2025 · 0 comments · May be fixed by #89057
Assignees
Labels
area: Xtensa Xtensa Architecture bug The issue is a bug, or the PR is fixing a bug

Comments

@gbarkadiusz
Copy link
Collaborator

Describe the bug
Twister throws error format specifier mismatch while building tests/misc/print_format test on ACE(15,20,30)

To Reproduce
scripts/twister -p intel_adsp/ace30/ptl/sim -T tests/misc/print_format -ll debug -b

Logs and console output

/tests/misc/print_format/src/main.c:11:33: error: format specifies type 'char' but the argument has type 'int' [-Werror,-Wformat]
        printk("d%" PRId8 "\n", INT8_C(8));
                 ~~~~~~~~              ^
/twister-out/intel_adsp_ace30_ptl_sim/xt-clang/tests/misc/print_format/printk.format.picolibc/modules/picolibc/picolibc/include/stdint.h:398:19: note: expanded from macro 'INT8_C'
#define INT8_C(x)       x
                        ^
/tests/misc/print_format/src/main.c:12:35: error: format specifies type 'short' but the argument has type 'int' [-Werror,-Wformat]
        printk("d%" PRId16 "\n", INT16_C(16));
                 ~~~~~~~~~               ^~
/twister-out/intel_adsp_ace30_ptl_sim/xt-clang/tests/misc/print_format/printk.format.picolibc/modules/picolibc/picolibc/include/stdint.h:410:20: note: expanded from macro 'INT16_C'
#define INT16_C(x)      x
                        ^
/tests/misc/print_format/src/main.c:16:33: error: format specifies type 'char' but the argument has type 'int' [-Werror,-Wformat]
        printk("i%" PRIi8 "\n", INT8_C(8));
                 ~~~~~~~~              ^
/twister-out/intel_adsp_ace30_ptl_sim/xt-clang/tests/misc/print_format/printk.format.picolibc/modules/picolibc/picolibc/include/stdint.h:398:19: note: expanded from macro 'INT8_C'
#define INT8_C(x)       x
                        ^
/tests/misc/print_format/src/main.c:17:35: error: format specifies type 'short' but the argument has type 'int' [-Werror,-Wformat]
        printk("i%" PRIi16 "\n", INT16_C(16));
                 ~~~~~~~~~               ^~
/twister-out/intel_adsp_ace30_ptl_sim/xt-clang/tests/misc/print_format/printk.format.picolibc/modules/picolibc/picolibc/include/stdint.h:410:20: note: expanded from macro 'INT16_C'
#define INT16_C(x)      x
                        ^
/tests/misc/print_format/src/main.c:21:33: error: format specifies type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
        printk("o%" PRIo8 "\n", INT8_C(8));
                 ~~~~~~~~              ^
/twister-out/intel_adsp_ace30_ptl_sim/xt-clang/tests/misc/print_format/printk.format.picolibc/modules/picolibc/picolibc/include/stdint.h:398:19: note: expanded from macro 'INT8_C'
#define INT8_C(x)       x
                        ^
/tests/misc/print_format/src/main.c:22:35: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
        printk("o%" PRIo16 "\n", INT16_C(16));
                 ~~~~~~~~~               ^~
/twister-out/intel_adsp_ace30_ptl_sim/xt-clang/tests/misc/print_format/printk.format.picolibc/modules/picolibc/picolibc/include/stdint.h:410:20: note: expanded from macro 'INT16_C'
#define INT16_C(x)      x
                        ^
/tests/misc/print_format/src/main.c:26:34: error: format specifies type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
        printk("u%" PRIu8 "\n", UINT8_C(8));
                 ~~~~~~~~               ^
/twister-out/intel_adsp_ace30_ptl_sim/xt-clang/tests/misc/print_format/printk.format.picolibc/modules/picolibc/picolibc/include/stdint.h:400:20: note: expanded from macro 'UINT8_C'
#define UINT8_C(x)      x
                        ^
/tests/misc/print_format/src/main.c:27:36: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
        printk("u%" PRIu16 "\n", UINT16_C(16));
                 ~~~~~~~~~                ^~
/twister-out/intel_adsp_ace30_ptl_sim/xt-clang/tests/misc/print_format/printk.format.picolibc/modules/picolibc/picolibc/include/stdint.h:412:21: note: expanded from macro 'UINT16_C'
#define UINT16_C(x)     x
                        ^
/tests/misc/print_format/src/main.c:31:34: error: format specifies type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
        printk("x%" PRIx8 "\n", UINT8_C(8));
                 ~~~~~~~~               ^
/twister-out/intel_adsp_ace30_ptl_sim/xt-clang/tests/misc/print_format/printk.format.picolibc/modules/picolibc/picolibc/include/stdint.h:400:20: note: expanded from macro 'UINT8_C'
#define UINT8_C(x)      x
                        ^
/tests/misc/print_format/src/main.c:32:36: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
        printk("x%" PRIx16 "\n", UINT16_C(16));
                 ~~~~~~~~~                ^~
/twister-out/intel_adsp_ace30_ptl_sim/xt-clang/tests/misc/print_format/printk.format.picolibc/modules/picolibc/picolibc/include/stdint.h:412:21: note: expanded from macro 'UINT16_C'
#define UINT16_C(x)     x
                        ^
/tests/misc/print_format/src/main.c:36:34: error: format specifies type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
        printk("X%" PRIX8 "\n", UINT8_C(8));
                 ~~~~~~~~               ^
/twister-out/intel_adsp_ace30_ptl_sim/xt-clang/tests/misc/print_format/printk.format.picolibc/modules/picolibc/picolibc/include/stdint.h:400:20: note: expanded from macro 'UINT8_C'
#define UINT8_C(x)      x
                        ^
/tests/misc/print_format/src/main.c:37:36: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
        printk("X%" PRIX16 "\n", UINT16_C(16));
                 ~~~~~~~~~                ^~
/twister-out/intel_adsp_ace30_ptl_sim/xt-clang/tests/misc/print_format/printk.format.picolibc/modules/picolibc/picolibc/include/stdint.h:412:21: note: expanded from macro 'UINT16_C'
#define UINT16_C(x)     x
                        ^
12 errors generated.

Environment:

  • OS: Linux
  • Toolchain: xt-clang
  • Commit SHA: Latest upstream (eca5790)
@gbarkadiusz gbarkadiusz added bug The issue is a bug, or the PR is fixing a bug area: Xtensa Xtensa Architecture labels Apr 24, 2025
dcpleung added a commit to dcpleung/zephyr that referenced this issue Apr 24, 2025
For some reasons, xt-clang does not like "%hhd" or "%hd"
(for example) being fed int data (same goes for unsigned ones)
and will always complain about mismatched types. GCC and newer
LLVM/Clang do not complain. This could be due to xt-clang
being based on older LLVM/Clang. So skip the check.

Fixes: zephyrproject-rtos#89008

Signed-off-by: Daniel Leung <[email protected]>
dcpleung added a commit to dcpleung/zephyr that referenced this issue Apr 24, 2025
For some reasons, xt-clang does not like "%hhd" or "%hd"
(for example) being fed int data (same goes for unsigned ones)
and will always complain about mismatched types. GCC and newer
LLVM/Clang do not complain. This could be due to xt-clang
being based on older LLVM/Clang. So skip the check.

Fixes: zephyrproject-rtos#89008

Signed-off-by: Daniel Leung <[email protected]>
@dcpleung dcpleung linked a pull request Apr 24, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Xtensa Xtensa Architecture bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants