| Summary: | dbus-send fails to build with -Werror=maybe-uninitialized on Debian gcc 7.2.0-7 | ||
|---|---|---|---|
| Product: | dbus | Reporter: | Simon McVittie <smcv> |
| Component: | core | Assignee: | Simon McVittie <smcv> |
| Status: | RESOLVED FIXED | QA Contact: | D-Bus Maintainers <dbus> |
| Severity: | normal | ||
| Priority: | medium | Keywords: | patch |
| Version: | 1.10 | ||
| Hardware: | Other | ||
| OS: | All | ||
| Whiteboard: | review+ | ||
| i915 platform: | i915 features: | ||
| Attachments: | dbus-send: Reassure the compiler that secondary_type is initialized | ||
Created attachment 134464 [details] [review] dbus-send: Reassure the compiler that secondary_type is initialized It's initialized to a non-trivial value whenever container_type is DBUS_TYPE_DICT_ENTRY, and subsequently only used if container_type is DBUS_TYPE_DICT_ENTRY, but Debian's gcc 7.2.0-7 doesn't seem to be able to infer that any more, causing build failure under -Werror=maybe-uninitialized. Comment on attachment 134464 [details] [review] dbus-send: Reassure the compiler that secondary_type is initialized Review of attachment 134464 [details] [review]: ----------------------------------------------------------------- ++ Thanks, fixed in git for 1.11.18 and 1.10.24. |
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.
/home/smcv/src/dbus-1.10/tools/dbus-send.c: In function ‘main’: /home/smcv/src/dbus-1.10/tools/dbus-send.c:185:7: error: ‘secondary_type’ may be used uninitialized in this function [-Werror=maybe-uninitialized] append_arg (&subiter, valtype, val); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/smcv/src/dbus-1.10/tools/dbus-send.c:461:11: note: ‘secondary_type’ was declared here int secondary_type; ^~~~~~~~~~~~~~ Oddly, the same version of gcc seems to be happy with dbus-send from git master, which has equivalent behaviour. The code is essentially this: if (container_type == DICT_ENTRY) secondary_type = ...; ... if (container_type == DICT_ENTRY) call_a_function (secondary_type);