[Debian-med-packaging] Bug#626757: libgtextutils: Ignored return value caused build failure when warn_unused_result is error.

Charles Plessy plessy at debian.org
Sun May 15 02:19:12 UTC 2011


Package: libgtextutils
Severity: normal

(Report recorded on the Debian bug tracking system).

Dear Gordon,

while trying to build libgtextutils on Ubuntu, I faced another compilation
error, unrelated to the one I reported earlier.

Ubuntu treats the compiler warning “warn_unused_result” as an error.  In
libgtextutils's /tests/test_pipe_fitter.c file, the return of the write()
function is ignored, triggering this error.  I tried to silence it by adding
(void) in front of “write”, but this did not work.  I then resorted by
inserting the command in a conditional that does nothing.  This is unclean but
allowed me to compile libgtextutils on Ubuntu Natty.

diff --git a/tests/test_pipe_fitter.c b/tests/test_pipe_fitter.c
index 8076543..afc5f12 100644
--- a/tests/test_pipe_fitter.c
+++ b/tests/test_pipe_fitter.c
@@ -39,7 +39,7 @@ int main()
 
        //Pipe output through a GZIP program
        fd = pipe_output_command ( "gzip", "pipe_out.txt.gz", &pid ) ;
-       write ( fd, text, strlen(text))  ;
+       if(write ( fd, text, strlen(text))) {}  ;
        pipe_close(fd, pid);
 
 
I am not a C programmer.  You probably have a better solution ?

Have a nice sunday,

-- 
Charles





More information about the Debian-med-packaging mailing list