bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnulib] compilation warning


From: Chuanchang Jia
Subject: [gnulib] compilation warning
Date: Mon, 30 Jan 2012 14:04:02 +0800

Hi all,
I'm compiling libvirt project, and I met the following compilation warning when run 'make check',
I saw our codes haven't done any check for return value of 'read', 'write' and 'pipe' operations in
test-poll.c. IMHO, we should check related return value, although it's just a test case.

<snip>
CCLD   test-poll-h
CC     test-poll.o
test-poll.c: In function 'test_accept_first':
test-poll.c:265: warning: ignoring return value of 'write', declared with attribute warn_unused_result
test-poll.c:266: warning: ignoring return value of 'read', declared with attribute warn_unused_result
test-poll.c:278: warning: ignoring return value of 'write', declared with attribute warn_unused_result
test-poll.c:282: warning: ignoring return value of 'read', declared with attribute warn_unused_result
test-poll.c:283: warning: ignoring return value of 'write', declared with attribute warn_unused_result
test-poll.c: In function 'test_pair':
test-poll.c:307: warning: ignoring return value of 'write', declared with attribute warn_unused_result
test-poll.c:315: warning: ignoring return value of 'read', declared with attribute warn_unused_result
test-poll.c: In function 'test_socket_pair':
test-poll.c:335: warning: ignoring return value of 'write', declared with attribute warn_unused_result
test-poll.c: In function 'test_pipe':
test-poll.c:350: warning: ignoring return value of 'pipe', declared with attribute warn_unused_result
</snip>


I haven't list compiler flags in here, for details, please see this link:
http://libvirt.org/git/?p=libvirt.git;a=summary

I commited a patch to enhance check in attachment.
 
gcc-4.4.6-3.el6.x86_64
make-3.81-19.el6.x86_64


Regards,
Alex

Attachment: test_poll.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]