From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69749: (bindat-type sint 32 t) -> unbound variable bitlen Date: Sat, 16 Mar 2024 13:16:17 +0200 Message-ID: <861q8a77ge.fsf@gnu.org> References: <82a56165-7684-4f10-a6c4-60ff27de0417@risk-engineering.org> <86cyrytkk7.fsf@gnu.org> <4a7ccaf7-02dc-4cca-b6e7-520ffb45dcac@risk-engineering.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40019"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69749@debbugs.gnu.org, eric.marsden@risk-engineering.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 16 12:17:39 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rlS2l-000ADf-A7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Mar 2024 12:17:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlS2Z-0004fC-O5; Sat, 16 Mar 2024 07:17:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlS2X-0004es-Ha for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2024 07:17:25 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rlS2X-0001YX-96 for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2024 07:17:25 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rlS37-0001yE-M0 for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2024 07:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Mar 2024 11:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69749 X-GNU-PR-Package: emacs Original-Received: via spool by 69749-submit@debbugs.gnu.org id=B69749.17105878277492 (code B ref 69749); Sat, 16 Mar 2024 11:18:01 +0000 Original-Received: (at 69749) by debbugs.gnu.org; 16 Mar 2024 11:17:07 +0000 Original-Received: from localhost ([127.0.0.1]:55007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlS2F-0001wl-1V for submit@debbugs.gnu.org; Sat, 16 Mar 2024 07:17:07 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlS2D-0001w7-AG for 69749@debbugs.gnu.org; Sat, 16 Mar 2024 07:17:05 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlS1W-0001VM-Ha; Sat, 16 Mar 2024 07:16:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=yDM/zjq0YMMu7m2VyHGsYZX50ue0hHuHyg3ENAH9njk=; b=hCn3jauDQB6XZq8e/Zsn EV1G9cBR2MIrD9GKZbaOXBn/PAY0eBcE6zmiCXPgP9wfftkUN2GYG4/2qosyHYezAh25L2owqXAM2 TNbXqqkfPT+kngLK0RtoCkrygkO5kRfbxxJO7t+70DB0JJpO+9odaDOXe4ygPFcQgM25ao16k4zj9 C5cMN7GUaIaAbwretclfhnlHRqpNT3kmffkvqsQ9g8Z6exCtB4bazyuzdINe1U9QBY8IPHoC2waLK JxY5XGYUH3A7B6qdqHy+xqy32IJHTgKyOUz/hsdQlaZLL5HVSOu64pilbTm8ksVCj9jvXsYjlwl52 o+v5E+DKL1G/sA==; In-Reply-To: (message from Stefan Monnier on Fri, 15 Mar 2024 12:51:36 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281721 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , 69749@debbugs.gnu.org > Date: Fri, 15 Mar 2024 12:51:36 -0400 > > >> Your code ends up (via the `sint` of `bindat-type`) relying on the > >> `lexical-binding` dialect of ELisp, which is enabled by default in > >> `ielm` but not in your file. > > Indeed, thanks for the fix. > > Perhaps it would be useful for the bindat-type macro to emit a warning when > > it is running in the dynamic-binding dialect (at least for the types that > > require lexical binding)? > > Agreed. I just pushed a corresponding patch to `master`. > It impacts only `sint` (among the predefined types). > > > This would have no runtime cost when byte-compiled or native-compiled, > > I assume. > > The patch I installed indeed doesn't impact the performance of the code. > The underlying detail which requires `lexical-binding` to be active does > cause the code for `sint` to be significantly less efficient than that > for `uint`, tho, so if performance is important, you may prefer to use > `uint` and do the conversion to a signed integer manually elsewhere. 🙁 Thanks, should we now close this bug?