-
Notifications
You must be signed in to change notification settings - Fork 172
Fix clang warnings #842
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
sidt4
wants to merge
7
commits into
PackageKit:main
Choose a base branch
from
sidt4:clang-fixes
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.
Open
Fix clang warnings #842
Conversation
This file contains hidden or 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
* - Tested on Clang 20 too:
|
With #844 merged, the FreeBSD warnings are clearly visible in https://api.cirrus-ci.com/v1/task/4722967877255168/logs/build.log. |
Above push is rebase to |
I use the wide-github firefox extension, so the 2 side-by-side images above fit perfectly for easy viewing. If it (side-by-side layout) is not recommended, please let me know, I'll use vertical spaces in future. |
../client/pk-console.c:1719:9: warning: missing field 'short_name' initializer [-Wmissing-field-initializers] 1719 | { NULL} | ^ ../client/pk-monitor.c:331:9: warning: missing field 'short_name' initializer [-Wmissing-field-initializers] 331 | { NULL} | ^ G_OPTION_ENTRY_NULL was introduced in glib commit https://gitlab.gnome.org/GNOME/glib/-/commit/2e4524cd3, which is avaiable from 2.70. Since, 2.70 is quite old (release: 2021-09-17), it's fine to bump glib version than copying / maintaining the macro within PackageKit.
../lib/packagekit-glib2/pk-bitfield.c:52:8: warning: variable 'i' set but not used [-Wunused-but-set-variable] 52 | guint i; | ^ ../lib/packagekit-glib2/pk-bitfield.c:93:8: warning: variable 'i' set but not used [-Wunused-but-set-variable] 93 | guint i; | ../src/pk-scheduler.c:858:8: warning: variable 'running' set but not used [-Wunused-but-set-variable] 858 | guint running = 0; | ^ ../src/pk-scheduler.c:860:8: warning: variable 'no_commit' set but not used [-Wunused-but-set-variable] 860 | guint no_commit = 0; | ^
[231/250] Compiling C object client/pkmon.p/pk-monitor.c.o warning: unknown warning option '-Wclobbered' [-Wunknown-warning-option] 1 warning generated. [238/250] Compiling C object client/pkcon.p/pk-console.c.o warning: unknown warning option '-Wclobbered' [-Wunknown-warning-option] 1 warning generated. [246/250] Compiling C object contrib/gstreamer-plugin/pk-gstreamer-install.p/pk-gstreamer-install.c.o warning: unknown warning option '-Wclobbered' [-Wunknown-warning-option] 1 warning generated.
…curity flag This should fix the following incorrect meson error: Compiler for C supports arguments -Werror=format-security: NO Refer: mesonbuild/meson#5790 Follow up to previous commit 6133d81d8.
Already part of default compiler flags.
GCC works fine either ways, but clang gives '-Wunused-parameter` warnings when `-Wextra` is after '-Wno-unused-parameter' in command line. ../client/pk-console.c:485:46: warning: unused parameter 'data' [-Wunused-parameter] 485 | pk_console_files_cb (PkFiles *item, gpointer data) | ^ ../client/pk-console.c:833:41: warning: unused parameter 'object' [-Wunused-parameter] 833 | pk_console_client_finished_cb (GObject *object, GAsyncResult *res, gpointer data) | ^ ../client/pk-console.c:845:39: warning: unused parameter 'object' [-Wunused-parameter] 845 | pk_console_task_finished_cb (GObject *object, GAsyncResult *res, gpointer data) | ^
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Please refer commit logs.