unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: master 0da97d6: * src/keyboard.c (timer_check_2): Replace redundant test with assertion
Date: Fri, 05 Aug 2022 17:41:00 -0400	[thread overview]
Message-ID: <jwvk07mtls0.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83fsiazh5y.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 Aug 2022 21:20:09 +0300")

Eli Zaretskii [2022-08-05 21:20:09] wrote:
> IMNSHO, this change is dangerous: it replaces run-time conditions with
> assertions, but IME most if not all of the active developers and
> people who track the master branch don't compile with --enable-checking,
> or don't run the trunk build on a regular basis.  Which means these
> assertions, if they happen, will not be seen nor reported.
>
> So basically you removed a safety net without any replacement.
>
> I suggest to revert this change.  It gains us nothing of importance.

I introduced a bug in my code which made the test fail, which made me
discover that:
- the test currently can never fail (because the code that leads to this
  point checks the condition earlier).
- if the test were to fail, Emacs would lock up in an inf-loop.
I kept an `eassert` basically to document the assumption.


        Stefan




  reply	other threads:[~2022-08-05 21:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05 18:20 master 0da97d6: * src/keyboard.c (timer_check_2): Replace redundant test with assertion Eli Zaretskii
2022-08-05 21:41 ` Stefan Monnier [this message]
2022-08-06  5:42   ` Eli Zaretskii

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=jwvk07mtls0.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).