-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Re-enable -Wno-unused-variable
for clang
#83833
Draft
thughes
wants to merge
6
commits into
zephyrproject-rtos:main
Choose a base branch
from
thughes:fix-unused-variable-warnings
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Re-enable -Wno-unused-variable
for clang
#83833
thughes
wants to merge
6
commits into
zephyrproject-rtos:main
from
thughes:fix-unused-variable-warnings
+320
−1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3da13d7
to
d90ea7b
Compare
-Wno-unused-variable
for clang
nordicjm
reviewed
Jan 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this gives erroneous warnings, why is it being enabled?
d90ea7b
to
6e803d8
Compare
cac9484
to
981b0ce
Compare
Building with clang warns: tests/drivers/i2c/i2c_emul/src/test_forwarding_pio.cpp:19:32: error: unused variable 'targets' [-Werror,-Wunused-const-variable] constexpr const struct device *targets[FORWARD_COUNT] = { ^ Signed-off-by: Tom Hughes <[email protected]>
Building with clang warns: tests/drivers/i2c/i2c_emul/src/test_forwarding_buf.cpp:20:32: error: unused variable 'targets' [-Werror,-Wunused-const-variable] constexpr const struct device *targets[FORWARD_COUNT] = { ^ Signed-off-by: Tom Hughes <[email protected]>
d561793
to
b7b14f5
Compare
In order to support new toolchains that are not compatible with gcc/clang (e.g., IAR), we need to add a level of indirection for the name of warnings. Signed-off-by: Tom Hughes <[email protected]>
tests/subsys/mgmt/mcumgr/settings_mgmt/src/main.c:69:22: error: variable 'test_response_read_data_start' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static const uint8_t test_response_read_data_start[5] = { ^ tests/subsys/mgmt/mcumgr/settings_mgmt/src/main.c:73:22: error: variable 'test_response_read_data_end' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static const uint8_t test_response_read_data_end[1] = { ^ Signed-off-by: Tom Hughes <[email protected]>
tests/subsys/usb/bos/src/test_bos.c:24:22: error: variable 'dummy_descriptor' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static const uint8_t dummy_descriptor[] = { ^ Signed-off-by: Tom Hughes <[email protected]>
All warnings in the code base have been resolved. Signed-off-by: Tom Hughes <[email protected]>
b7b14f5
to
d35ae8a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: Build System
area: I2C
area: mcumgr
area: Toolchains
Toolchains
area: USB
Universal Serial Bus
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This has a dependency on #84063