From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: System calls without error checks in w32 Date: Sun, 30 May 2010 05:26:32 +0200 Message-ID: References: <83ocfytxhg.fsf@gnu.org> <83mxvitsay.fsf@gnu.org> <83ljb2tn6i.fsf@gnu.org> <83k4qmt7lb.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1275190027 32112 80.91.229.12 (30 May 2010 03:27:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 30 May 2010 03:27:07 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 30 05:27:05 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 1OIZB2-0001ur-Gj for ged-emacs-devel@m.gmane.org; Sun, 30 May 2010 05:27:05 +0200 Original-Received: from localhost ([127.0.0.1]:50094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIZB1-0006JI-3f for ged-emacs-devel@m.gmane.org; Sat, 29 May 2010 23:27:03 -0400 Original-Received: from [140.186.70.92] (port=45188 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIZAs-0006I3-Ic for emacs-devel@gnu.org; Sat, 29 May 2010 23:26:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OIZAr-0002ty-5Y for emacs-devel@gnu.org; Sat, 29 May 2010 23:26:54 -0400 Original-Received: from mail-gw0-f41.google.com ([74.125.83.41]:41357) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIZAr-0002tt-0t; Sat, 29 May 2010 23:26:53 -0400 Original-Received: by gwb19 with SMTP id 19so2505015gwb.0 for ; Sat, 29 May 2010 20:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=AgGHiRQLQnCPac622HhJb/RuYu5Nw5LICpTmhYHcq78=; b=Whs5AJKGYapN3Ro0UJrAqzjpem2i2ACeTBRy7A1oln4mMkeLFmtZSCa2vVYJPVuAAz FnuPUN0aZLdzRCUBUph3itkzsToHhybeLmF6tDaWpOCNMoR5TPDnV1sISguCl6NGMDqT xfwtJctAJcuNA0jebbMl6W8tUOC6QqutsOUQE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=Ts/y5HbBYdFIkVKVrzOffHWdd6kbVxQNtnepwYi5xgbKiL1uP4ZiYurU7wTHrK99Pd 1voze84c/79sAHIuN1mOrNgfBWUxvov4cquHdTMBbrgYDYVLedLkXN0IM0DOo6PO61dN 60rMt3jRuE433xMvWYYdey4FyCguDWKVdEmQw= Original-Received: by 10.101.3.38 with SMTP id f38mr2690232ani.90.1275190012173; Sat, 29 May 2010 20:26:52 -0700 (PDT) Original-Received: by 10.100.44.20 with HTTP; Sat, 29 May 2010 20:26:32 -0700 (PDT) In-Reply-To: <83k4qmt7lb.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:125356 Archived-At: On Sun, May 30, 2010 at 5:02 AM, Eli Zaretskii wrote: > > 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. Are you saying that checking the return values of system calls should be avoided because it makes the code to difficult to read? I can't imagine you mean that. What do you mean? Exactly what in my suggestion makes the code to hard to read? How can the check be made more readable? (I can't see how GLYPH_DEBUG style handling of it applies here.) Remember that what I suggest is basically if (bad_return_value) DebPrint (("error this_function.ApiFunction => %d", bad_return_value)); It can be visually more appealing with a macro, something like W32DEBPRINT (this_function, ApiFunction, bad_return_value, 0); Is that what you mean? This is of course what I meant, but my C fu is low, and so my C language. So we might misunderstand each other.