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

tests: logging: log_backend_uart: fix build error #75595

Conversation

evgeniy-paltsev
Copy link
Collaborator

@evgeniy-paltsev evgeniy-paltsev commented Jul 8, 2024

Currently we get the build error when building tests/subsys/logging/log_backend_uart with MWDT toolchain:

error: static_assert expression is not an integral constant expression
BUILD_ASSERT(strlen(TEST_DATA) < SAMPLE_DATA_SIZE);
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It can be easily workarounded by using sizeof instead of strlen to calculate string size.

Fixes: #75599

Currently we get the build error when building
'tests/subsys/logging/log_backend_uart':

error: static_assert expression is not an integral constant expression
BUILD_ASSERT(strlen(TEST_DATA) < SAMPLE_DATA_SIZE);
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It can be easily workarounded by using sizeof instead of strlen
to calculate string size.

Signed-off-by: Evgeniy Paltsev <[email protected]>
Signed-off-by: Eugeniy Paltsev <[email protected]>
@evgeniy-paltsev evgeniy-paltsev changed the title tests: logging: fix build error tests: logging: log_backend_uart: fix build error Jul 8, 2024
@evgeniy-paltsev evgeniy-paltsev marked this pull request as ready for review July 8, 2024 14:16
@evgeniy-paltsev evgeniy-paltsev added the bug The issue is a bug, or the PR is fixing a bug label Jul 8, 2024
@nashif nashif added the Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. label Jul 8, 2024
@aescolar aescolar merged commit 4b9828c into zephyrproject-rtos:main Jul 9, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Logging bug The issue is a bug, or the PR is fixing a bug Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests: logging: log_backend_uart: fix build error with MWDT toolchain
7 participants