From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Neil Jerram" Newsgroups: gmane.lisp.guile.devel Subject: Re: `scm_c_read ()' and `swap_buffer' trick harmful Date: Sun, 23 Nov 2008 22:30:19 +0000 Message-ID: <49dd78620811231430o5f0d6dc7u16c2fbf29b73c57c@mail.gmail.com> References: <87vduo92nj.fsf@gnu.org> <49dd78620811200522k315281c8m9d952a17145b2479@mail.gmail.com> <871vx6ik42.fsf@gnu.org> <49dd78620811201425j5dcd7e0g4165c8ea4c6b08ce@mail.gmail.com> <87fxllt3f7.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1227479438 19658 80.91.229.12 (23 Nov 2008 22:30:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Nov 2008 22:30:38 +0000 (UTC) Cc: guile-devel@gnu.org To: "=?ISO-8859-1?Q?Ludovic_Court=E8s?=" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Nov 23 23:31:40 2008 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L4NUR-0000pU-Gm for guile-devel@m.gmane.org; Sun, 23 Nov 2008 23:31:39 +0100 Original-Received: from localhost ([127.0.0.1]:48849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L4NTI-0003jO-2J for guile-devel@m.gmane.org; Sun, 23 Nov 2008 17:30:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L4NTE-0003j1-Iy for guile-devel@gnu.org; Sun, 23 Nov 2008 17:30:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L4NTC-0003iK-5l for guile-devel@gnu.org; Sun, 23 Nov 2008 17:30:23 -0500 Original-Received: from [199.232.76.173] (port=53498 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L4NTB-0003iH-Vd for guile-devel@gnu.org; Sun, 23 Nov 2008 17:30:22 -0500 Original-Received: from rv-out-0708.google.com ([209.85.198.244]:10992) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L4NTA-0006vs-Uw for guile-devel@gnu.org; Sun, 23 Nov 2008 17:30:21 -0500 Original-Received: by rv-out-0708.google.com with SMTP id k29so1956219rvb.6 for ; Sun, 23 Nov 2008 14:30:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=X/loekTP6IrZUgKYuCbtiHKNPGjEWHUoTZT/BwTQxlQ=; b=wA0HNAhHqRh6m1vKvNKMbvQAz3cfutVUAxApE38mqTMyfZAlGi+qteHj6EL3t0LBxr iSH7jpciYTHHIbp3T/yv14dtk3wEbZnm9cBeWOYvV00cuWTFo1D2ghN/RK9SP00sRd+5 QnZggqsMlspTenX4cSnEQdviID0cpYZfzNAMo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=SN4InnDe8ygpWZGSo6MyKQEa8ESQzRMRJ/aFmlTwPPsy4rpeoTDeFx/HvL97eNE4Q8 e5e+cPDSkG9s/0niA5WsLTbdXx2TCx96npbKSiH/jp/UC6MrYKrVWucK352TeyEsst0/ ewjP8j5eTuRy8mxfR9H5DNEzacrktRcVe6E2M= Original-Received: by 10.141.176.13 with SMTP id d13mr1498712rvp.231.1227479419085; Sun, 23 Nov 2008 14:30:19 -0800 (PST) Original-Received: by 10.140.199.14 with HTTP; Sun, 23 Nov 2008 14:30:19 -0800 (PST) In-Reply-To: <87fxllt3f7.fsf@gnu.org> Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:7886 Archived-At: 2008/11/21 Ludovic Court=E8s : > Hi Neil, > > "Neil Jerram" writes: > >> 2008/11/20 Ludovic Court=E8s : >>> >>> In theory, yes. In practice, the notion of "unbuffered port" is >>> ill-defined, I'm afraid. The `SCM_BUF0' flag probably can't be relied >>> on, as it appears to be only really used on `fports.c'. Actually, for >>> some reason (probably copy & paste), make_cbip() creates ports with >>> "SCM_OPN | SCM_RDNG | SCM_BUF0", although `SCM_BUF0' is probably not >>> needed. So I think "unbuffered port" means "read_buf_size <=3D 1". >> >> That's what I was thinking too. Please see the attached. > > Thanks for the quick fix! > > I confirm it works with CBIPs in Guile-R6RS-Libs, but I had to make this > small change: > > http://repo.or.cz/w/guile-r6rs-libs.git?a=3Dcommitdiff;h=3Ddfab2fe21f82b= c40cfdf9a3a3eeb6936d5935c8c > > IOW, with Guile up to 1.8.5, it was harmless to leave `read_buf_size' > uninitialized (actually, zeroed), which was OK since CBIPs don't use it, > but the change in `scm_c_read ()' makes it necessary to initialize it. > It's probably a reasonable expectation, though. Hmm. I agree that this isn't ideal. I guess it's OK for now though. > Please commit! Thanks, doing that now. Neil