From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Martin Pitt Newsgroups: gmane.lisp.guile.bugs Subject: [bug #24009] does not check for short write()s Date: Wed, 06 Aug 2008 11:51:04 +0000 Message-ID: <20080806-115103.sv64725.45653@savannah.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Trace: ger.gmane.org 1218023503 22915 80.91.229.12 (6 Aug 2008 11:51:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Aug 2008 11:51:43 +0000 (UTC) To: Martin Pitt , bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Aug 06 13:52:33 2008 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KQhYw-0002P0-84 for guile-bugs@m.gmane.org; Wed, 06 Aug 2008 13:52:18 +0200 Original-Received: from localhost ([127.0.0.1]:57870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQhY0-0005mu-83 for guile-bugs@m.gmane.org; Wed, 06 Aug 2008 07:51:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQhXp-0005ir-Pp for bug-guile@gnu.org; Wed, 06 Aug 2008 07:51:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQhXn-0005gc-F4 for bug-guile@gnu.org; Wed, 06 Aug 2008 07:51:07 -0400 Original-Received: from [199.232.76.173] (port=41891 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQhXl-0005gR-Hw for bug-guile@gnu.org; Wed, 06 Aug 2008 07:51:05 -0400 Original-Received: from savannah.gnu.org ([199.232.41.3]:46815 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KQhXl-0002eR-4R for bug-guile@gnu.org; Wed, 06 Aug 2008 07:51:05 -0400 Original-Received: from [10.0.0.103] (helo=savannah.gnu.org) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KQhXk-0000sf-HG; Wed, 06 Aug 2008 11:51:04 +0000 Original-Received: from www-data by savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KQhXk-0000sb-9C; Wed, 06 Aug 2008 11:51:04 +0000 X-Savane-Server: savannah.gnu.org:443 [199.232.41.3] X-Savane-Project: guile X-Savane-Tracker: bugs X-Savane-Item-ID: 24009 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071816 Ubuntu/8.10 (intrepid) Firefox/3.0.1 X-Apparently-From: 87.157.237.91 (Savane authenticated user martinpitt) Original-References: In-Reply-To: X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:3954 Archived-At: URL: Summary: does not check for short write()s Project: Guile Submitted by: martinpitt Submitted on: Mittwoch 06.08.2008 um 11:51 Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: When building guile under current ubuntu (gcc-4.3, with FORTIFY_SOURCE=2), it detects a lot of cases where write() is called without checking the return value: /bin/bash ../libtool --tag=CC --mode=compile i486-linux-gnu-gcc -DHAVE_CONFIG_H -I.. -I.. -I.. -pthread -O2 -g -Wall -Wmissing-prototypes -Werror -MT libguile_la-async.lo -MD -MP -MF .deps/libguile_la-async.Tpo -c -o libguile_la-async.lo `test -f 'async.c' || echo './'`async.c i486-linux-gnu-gcc -DHAVE_CONFIG_H -I.. -I.. -I.. -pthread -O2 -g -Wall -Wmissing-prototypes -Werror -MT libguile_la-async.lo -MD -MP -MF .deps/libguile_la-async.Tpo -c async.c -fPIC -DPIC -o .libs/libguile_la-async.o cc1: warnings being treated as errors async.c: In function ‘scm_i_queue_async_cell’: async.c:250: error: ignoring return value of ‘write’, declared with attribute warn_unused_result Some of those might actually be harmless and can be cast into (void), but in most cases a short write is a source of unexpected and hard to debug errors. Maybe consider using a full_write() wrapper (like in gnulib) which repeatedly writes until everything is sent? _______________________________________________________ Reply to this item at: _______________________________________________ Nachricht geschickt von/durch Savannah http://savannah.gnu.org/