Unable to compile on ubuntu 12.04 due to warnings-as-errors in libcubeb

RESOLVED FIXED in Firefox 33

Status

()

Core
General
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: bkelly, Assigned: cpeterson)

Tracking

({regression})

unspecified
mozilla33
x86_64
Linux
regression
Points:
---

Firefox Tracking Flags

(firefox32 unaffected, firefox33 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
I can no longer build mozilla-central on my ubuntu 12.04 virtual machine:

 0:58.95 /srv/mozilla-central/media/libcubeb/src/cubeb_alsa.c: In function ‘poll_wake’:
 0:58.95 /srv/mozilla-central/media/libcubeb/src/cubeb_alsa.c:223:8: error: ignoring return value of ‘write’
, declared with attribute warn_unused_result [-Werror=unused-result]
 0:58.95 /srv/mozilla-central/media/libcubeb/src/cubeb_alsa.c: In function ‘alsa_run’:
 0:58.95 /srv/mozilla-central/media/libcubeb/src/cubeb_alsa.c:375:11: error: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Werror=unused-result]
 0:58.95 cc1: all warnings being treated as errors
(Reporter)

Updated

4 years ago
Assignee: nobody → paul
(Assignee)

Comment 1

4 years ago
Ben: Sorry! What version of gcc are you using?

In the meantime, you should be able to add `ac_add_options --disable-warnings-as-errors` to your mozconfig to continue building.
status-firefox32: --- → unaffected
status-firefox33: --- → affected
Flags: needinfo?(bkelly)
(Reporter)

Comment 2

4 years ago
bkelly@lenir:/srv/mozilla-central/.hg/patches$ gcc --version
gcc-4.6.real (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04) 4.6.4

Thanks.  I just rolled back to a previous commit for now.
Flags: needinfo?(bkelly)
(Assignee)

Comment 3

4 years ago
Created attachment 8451133 [details] [diff] [review]
1034140_consume-unused-return-values.patch

Ben: when you have a chance, can you please test this patch?

I don't have a Linux build environment. My Android build environment uses gcc 4.6, but Android's system header files don't mark the read() and write() syscalls with the warn_unused_result attribute.

gcc doesn't let you cast away warn_unused_result warnings with (void), so this patch "handles" read() or write() errors with an empty body. I didn't see a obvious way to handle or log these errors, but the code looks like it doesn't care anyways.
Assignee: paul → cpeterson
Status: NEW → ASSIGNED
Attachment #8451133 - Flags: feedback?(bkelly)
(Reporter)

Comment 4

4 years ago
Comment on attachment 8451133 [details] [diff] [review]
1034140_consume-unused-return-values.patch

Chris, this seems to fix the build errors for me.  Thanks!
Attachment #8451133 - Flags: feedback?(bkelly) → feedback+
(Assignee)

Comment 5

4 years ago
Comment on attachment 8451133 [details] [diff] [review]
1034140_consume-unused-return-values.patch

Paul: gcc doesn't let you cast away warn_unused_result warnings with `(void)read(...)`, so this patch "handles" read() or write() errors with an if statement with an empty body. Would you prefer that we actually do something to handle read(control_fd_read) or write(control_fd_write) errors?
Attachment #8451133 - Attachment filename: 1034140_consume-unused-return-values.patch → consume-unused-return-values.patch
Attachment #8451133 - Flags: review?(paul)

Updated

4 years ago
Attachment #8451133 - Flags: review?(paul) → review+
(Reporter)

Comment 6

4 years ago
Any reason not to land this? :-)  Adding checkin-needed.
Keywords: checkin-needed
(Reporter)

Updated

4 years ago
Duplicate of this bug: 1036570
(Assignee)

Comment 8

4 years ago
Laziness? :) Sorry, I know this was breaking your local builds.

https://hg.mozilla.org/integration/mozilla-inbound/rev/f97c7b5e2994
status-firefox33: affected → fixed
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/f97c7b5e2994
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.