unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lennart Borgman <lennart.borgman@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: System calls without error checks in w32
Date: Sun, 30 May 2010 20:36:14 +0300	[thread overview]
Message-ID: <83hblpthpt.fsf@gnu.org> (raw)
In-Reply-To: <AANLkTinfOV0NRAjH3fmLOpx9CuuqtcgCyPZzMghjxgmR@mail.gmail.com>

> From: Lennart Borgman <lennart.borgman@gmail.com>
> Date: Sun, 30 May 2010 05:26:32 +0200
> Cc: emacs-devel@gnu.org
> 
> On Sun, May 30, 2010 at 5:02 AM, Eli Zaretskii <eliz@gnu.org> 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?

No.

> Remember that what I suggest is basically
> 
>    if (bad_return_value) DebPrint (("error this_function.ApiFunction
> => %d", bad_return_value));

What purpose does this serve?  This isn't "checking return values for
errors", because this has no effect for the majority of users who
don't run Emacs under a debugger.  Their Emacs will still crash if it
hits bad_return_value.  I thought you were arguing for making the
Emacs code more robust in the face of possible failures of the APIs it
calls.

If you want more debugging aids, I don't object, but then I have no
interest in such additions, either.  Typically, such additions are
only good as long as you debug some specific problem, so keeping them
in the code after that is waste of bytes.

>    W32DEBPRINT (this_function, ApiFunction, bad_return_value, 0);

This is even worse, because it's impossible to understand what this
does without looking up the magical W32DEBPRINT macro.



  reply	other threads:[~2010-05-30 17:36 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-29  2:38 System calls without error checks in w32 Lennart Borgman
2010-05-29 17:43 ` Eli Zaretskii
2010-05-29 18:42   ` Lennart Borgman
2010-05-29 19:35     ` Eli Zaretskii
2010-05-29 20:02       ` Lennart Borgman
2010-05-29 21:25         ` Eli Zaretskii
2010-05-29 21:30           ` Lennart Borgman
2010-05-30  3:02             ` Eli Zaretskii
2010-05-30  3:26               ` Lennart Borgman
2010-05-30 17:36                 ` Eli Zaretskii [this message]
2010-05-30 18:02                   ` Lennart Borgman
2010-05-30 19:24                     ` Juanma Barranquero
2010-05-30 22:37                       ` Lennart Borgman
2010-05-30 23:03                         ` Juanma Barranquero
2010-05-30 23:28                           ` Lennart Borgman
2010-05-31  0:10                             ` Juanma Barranquero
2010-05-31  0:58                               ` Lennart Borgman
2010-05-31  2:02                                 ` Juanma Barranquero
2010-05-31  2:36                                   ` Lennart Borgman
2010-05-31  3:06                                     ` Juanma Barranquero
2010-05-31  3:05                         ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2010-05-31  9:18 grischka
2010-06-05 17:15 ` Jason Rumney
2010-06-07 10:37   ` grischka
2010-06-07 14:54     ` Stephen J. Turnbull
2010-06-07 15:23       ` Lennart Borgman
2010-06-07 17:21         ` grischka
2010-06-07 17:30           ` Lennart Borgman
2010-06-07 18:54             ` grischka
2010-06-08  0:32               ` Lennart Borgman
2010-06-08  0:34                 ` Lennart Borgman
2010-06-07 19:56         ` Stefan Monnier
2010-06-07 23:35           ` Lennart Borgman

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/emacs/

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

  git send-email \
    --in-reply-to=83hblpthpt.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).