From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: System calls without error checks in w32 Date: Sun, 30 May 2010 06:02:40 +0300 Message-ID: <83k4qmt7lb.fsf@gnu.org> References: <83ocfytxhg.fsf@gnu.org> <83mxvitsay.fsf@gnu.org> <83ljb2tn6i.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1275188625 29620 80.91.229.12 (30 May 2010 03:03:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 30 May 2010 03:03:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lennart Borgman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 30 05:03:43 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OIYoR-0006Lz-7N for ged-emacs-devel@m.gmane.org; Sun, 30 May 2010 05:03:43 +0200 Original-Received: from localhost ([127.0.0.1]:47628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIYoQ-00035T-EF for ged-emacs-devel@m.gmane.org; Sat, 29 May 2010 23:03:42 -0400 Original-Received: from [140.186.70.92] (port=44594 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIYoK-00035O-3p for emacs-devel@gnu.org; Sat, 29 May 2010 23:03:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OIYoI-0001AY-8T for emacs-devel@gnu.org; Sat, 29 May 2010 23:03:35 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:51360) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIYoH-0001AH-WD for emacs-devel@gnu.org; Sat, 29 May 2010 23:03:34 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L3700M00PK7VW00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sun, 30 May 2010 06:02:40 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.245.238]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L3700KWQPSE4VC0@a-mtaout20.012.net.il>; Sun, 30 May 2010 06:02:40 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:125355 Archived-At: > From: Lennart Borgman > Date: Sat, 29 May 2010 23:30:21 +0200 > Cc: emacs-devel@gnu.org > > On Sat, May 29, 2010 at 11:25 PM, Eli Zaretskii wrote: > >> From: Lennart Borgman > >> Date: Sat, 29 May 2010 22:02:24 +0200 > >> Cc: emacs-devel@gnu.org > >> > >> > If you can suggest what to do when any of these fails, please do. > >> > >> > >> I have already made the suggestion below. > > > > How in the world outputting an error message would help here? > > You mean instead of fixing the error directly? It is just a first step > of course. > > The error message might also be interesting in itself. It can for > example tell about resources lack etc. The API descriptions does not > always tell the whole story. Checking values returned by system calls is necessary to avoid working with invalid objects returned by a failed system call. I thought you were talking about this. But it turns out you are talking about something else altogether: how to debug possible failures in some APIs. That is a different story and it requires different solutions. Please take a look at xdisp.c and friends, which have special debugging code inside #ifdef GLYPH_DEBUG. In any case, the solution you suggest is not a good one, because it obfuscates the source code and makes it harder to read and understand.