Summary: | clean up unused variables, dead code | ||
---|---|---|---|
Product: | dbus | Reporter: | Simon McVittie <smcv> |
Component: | core | Assignee: | Simon McVittie <smcv> |
Status: | RESOLVED FIXED | QA Contact: | John (J5) Palmieri <johnp> |
Severity: | trivial | ||
Priority: | low | CC: | hp |
Version: | 1.5 | Keywords: | patch |
Hardware: | Other | ||
OS: | All | ||
URL: | http://cgit.freedesktop.org/~smcv/dbus/log/?h=more-unused-39231 | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Bug Depends on: | 38005, 39230 | ||
Bug Blocks: | 36164 | ||
Attachments: | Enable more compiler warnings by default |
Description
Simon McVittie
2011-07-14 11:01:50 UTC
Here are patches. I'll spare you the attachment bugspam, because there are 11 so far. Bug #39230 and Bug #38005 also produce warnings, which are not addressed here. http://cgit.freedesktop.org/~smcv/dbus/log/?h=unused-39231 All eleven patches—up to and including “_dbus_lookup_session_address_launchd: don't define if not used”—look fine to me. Thanks, merged for 1.5.8. I'll leave this bug open, because there are more unused variables if you either: * build on master, or * don't assert, or * don't return_if_fail Branch more-unused-39231 fixes more warnings. Eventually, I'd like to apply the patch that I'm about to attach, to make unused stuff fatal; but it's blocked by Bug #39230 as well as this one. Created attachment 49955 [details] [review] Enable more compiler warnings by default Blocked by this bug and Bug #39230. When applying it, I'll also have to check that no more unused things have been introduced by then. This enables -Wextra, except for -Wunused-parameter (intentional), -Wmissing-field-initializers (intentional), -Wtype-limits (probably a bug, we can open one later), and -Wunused-label if either assertions or checks are disabled. (Rationale for -Wunused-label: unused labels rarely cause dead code, and at least one place in libdbus jumps to a label only if return_if_fail-style checks are enabled.) more-unused-39231 looks fine, as does the attached patch to enable more warnings (in principle). Fixed in git for 1.5.8. Unused variables, etc., are now considered to be an error. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.