unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Martin Pitt <INVALID.NOREPLY@gnu.org>
To: Martin Pitt <martin@piware.de>, bug-guile@gnu.org
Subject: [bug #24009] does not check for short write()s
Date: Wed, 06 Aug 2008 11:51:04 +0000	[thread overview]
Message-ID: <20080806-115103.sv64725.45653@savannah.gnu.org> (raw)
In-Reply-To: 


URL:
  <http://savannah.gnu.org/bugs/?24009>

                 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:

  <http://savannah.gnu.org/bugs/?24009>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/





             reply	other threads:[~2008-08-06 11:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06 11:51 Martin Pitt [this message]
2008-08-06 20:08 ` [bug #24009] does not check for short write()s Neil Jerram
2008-10-29 16:58   ` Adam Schreiber
2008-10-30 22:44     ` anonymous
2008-10-31  2:45       ` Adam Schreiber
2008-11-30 18:10         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080806-115103.sv64725.45653@savannah.gnu.org \
    --to=invalid.noreply@gnu.org \
    --cc=bug-guile@gnu.org \
    --cc=martin@piware.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).