Closed Bug 1034140 Opened 10 years ago Closed 10 years ago

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

Categories

(Core :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33
Tracking Status
firefox32 --- unaffected
firefox33 --- fixed

People

(Reporter: bkelly, Assigned: cpeterson)

References

Details

(Keywords: regression)

Attachments

(1 file)

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
Assignee: nobody → paul
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.
Flags: needinfo?(bkelly)
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)
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)
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+
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)
Attachment #8451133 - Flags: review?(paul) → review+
Any reason not to land this? :-)  Adding checkin-needed.
Keywords: checkin-needed
Laziness? :) Sorry, I know this was breaking your local builds.

https://hg.mozilla.org/integration/mozilla-inbound/rev/f97c7b5e2994
https://hg.mozilla.org/mozilla-central/rev/f97c7b5e2994
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: