Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 238060 - [PATCH] media-sound/alsa-tools-1.0.17: ignoring return value of 'write', declared with attribute warn_unused_result
Summary: [PATCH] media-sound/alsa-tools-1.0.17: ignoring return value of 'write', decl...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo ALSA team
URL: https://hardened.gentooexperimental.o...
Whiteboard:
Keywords:
: 263360 (view as bug list)
Depends on:
Blocks: fortify-source werror
  Show dependency tree
 
Reported: 2008-09-19 00:08 UTC by Magnus Granberg
Modified: 2009-03-22 12:20 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix warn_unused_result in extract_ac3.c (warn_unused_result.patch,729 bytes, patch)
2008-09-19 00:09 UTC, Magnus Granberg
Details | Diff
fix the typo (warn_unused_result.patch,728 bytes, patch)
2008-09-19 16:54 UTC, Magnus Granberg
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Granberg gentoo-dev 2008-09-19 00:08:16 UTC
Fail to compile on glibc 2.8 and CFLAGS -D_FORTIFY_SOURCE=2
cc1: warnings being treated as errors extract_ac3.c: In function 'read_write_next_bytes': extract_ac3.c:163: warning: ignoring return value of 'write', declared with attribute warn_unused_result extract_ac3.c:174: warning: ignoring return value of 'write', declared with attribute warn_unused_result make[2]: *** [extract_ac3.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/media-sound/alsa-tools-1.0.17/work/alsa-tools-1.0.17/ac3dec/tools' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/media-sound/alsa-tools-1.0.17/work/alsa-tools-1.0.17/ac3dec' make: *** [all] Error 2


Reproducible: Always

Steps to Reproduce:
1.use the hardened gcc 4 toolchain-overlay or -D_FORTIFY_SOURCES=2 in CFLAGS
and glibc 2.8
2. emerge alsa-tools 1.0.17
3.

Actual Results:  
cc1: warnings being treated as errors extract_ac3.c: In function 'read_write_next_bytes': extract_ac3.c:163: warning: ignoring return value of 'write', declared with attribute warn_unused_result 


Expected Results:  
make[2]: Leaving directory `/var/tmp/portage/media-sound/alsa-tools-1.0.17/work/alsa-tools-1.0.17/ld10k1'
make[1]: Leaving directory `/var/tmp/portage/media-sound/alsa-tools-1.0.17/work/alsa-tools-1.0.17/ld10k1'
>>> Source compiled.

Portage 2.1.4.4 (hardened/linux/amd64/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r0, 2.6.25-gentoo-r7 x86_64)
=================================================================
System uname: 2.6.25-gentoo-r7 x86_64 Intel(R) Core(TM)2 Duo CPU T7700 @ 2.40GHz
Timestamp of tree: Thu, 11 Sep 2008 18:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-lang/python:     2.4.4-r13, 2.5.2-r6
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.61-r2
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r4
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ABI="amd64"
ACCEPT_KEYWORDS="amd64"
Comment 1 Magnus Granberg gentoo-dev 2008-09-19 00:09:34 UTC
Created attachment 165765 [details, diff]
fix  warn_unused_result in extract_ac3.c
Comment 2 Wormo (RETIRED) gentoo-dev 2008-09-19 07:02:40 UTC
Thanks for the patch. 

I think you need to update this line:
if(write(outfd, cur_pos, size) != count)

copy-paste-modify error... 'count' was from previous changed section
Comment 3 Gordon Malm (RETIRED) gentoo-dev 2008-09-19 14:03:13 UTC
Magnus, could you provide a link to the upstream ALSA bug report?
Comment 4 Magnus Granberg gentoo-dev 2008-09-19 16:54:44 UTC
Created attachment 165860 [details, diff]
fix the typo

fix the count -> size thing
Comment 5 Magnus Granberg gentoo-dev 2008-09-19 17:04:40 UTC
(In reply to comment #3)
> Magnus, could you provide a link to the upstream ALSA bug report?
> 
Will fix that later to day.

Comment 7 Magnus Granberg gentoo-dev 2008-12-04 00:33:03 UTC
Updated the URL
Comment 8 Magnus Granberg gentoo-dev 2009-02-25 22:03:28 UTC
alsa-tools-1.0.19 Compiles fine.
Comment 9 Magnus Granberg gentoo-dev 2009-02-27 22:11:15 UTC
Can some one confirmed this so i can close it?
Comment 10 Magnus Granberg gentoo-dev 2009-03-04 23:14:05 UTC
The -Werror is gone on 1.0.19
Comment 11 Peter Alfredsen (RETIRED) gentoo-dev 2009-03-22 12:20:45 UTC
*** Bug 263360 has been marked as a duplicate of this bug. ***