From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58865: 29.0.50; Warnings when compiling net/dbus.el Date: Mon, 31 Oct 2022 16:33:27 -0400 Message-ID: References: <86fsf6on1q.fsf@gnu.org> <87a65ellhn.fsf@gmx.de> <867d0iia40.fsf@gnu.org> <87zgdchto0.fsf@gmx.de> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11159"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 58865@debbugs.gnu.org, Arash Esbati To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 31 21:34:10 2022 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 1opbU2-0002hP-6N for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Oct 2022 21:34:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opbTw-0000is-St; Mon, 31 Oct 2022 16:34:04 -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 1opbTu-0000ic-UZ for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 16:34:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opbTu-0007vG-Lr for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 16:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opbTu-0001LI-GS for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2022 16:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Oct 2022 20:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58865 X-GNU-PR-Package: emacs Original-Received: via spool by 58865-submit@debbugs.gnu.org id=B58865.16672484205106 (code B ref 58865); Mon, 31 Oct 2022 20:34:02 +0000 Original-Received: (at 58865) by debbugs.gnu.org; 31 Oct 2022 20:33:40 +0000 Original-Received: from localhost ([127.0.0.1]:41936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opbTY-0001KI-54 for submit@debbugs.gnu.org; Mon, 31 Oct 2022 16:33:40 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:26800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opbTX-0001K3-9r for 58865@debbugs.gnu.org; Mon, 31 Oct 2022 16:33:39 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 169004417D4; Mon, 31 Oct 2022 16:33:33 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7CDF44415DC; Mon, 31 Oct 2022 16:33:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1667248411; bh=XlTwIAGriAFk8GuBAWXgmJuNwz/QHhIm15oyqBnmcyg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ncw4N03X/gVAXf3Kx/dCMKO77doI3l83eYMzK6xT/UWB4r8y9cg9WMN2JZyw9LMPy kII9zojvhZDidgsZsN1DS7tOcM/FC6hn9/mkpvcnmB3rThIlyzi7U4b6qL9nayGcrX DphhvHUwfrkngMfxWKOLDEHd7IAEQWXVyY+8Efni6ToX535iWP7cYRCHq9hau9QSwQ VMDVOuPt1J+Pei2UXcvMm6Y6ETwhlyhXbwDgfdh/nrEpF3/DYeDD7GeM16Cp8EU0tG zMG2hQui+L8aSL3O+0i8rgYB5UdaG7op4S0SS3WN5+KRJAympCtzBA0jJ+TY7+nRAt bjP2MVb4Pg66w== Original-Received: from alfajor (modemcable021.147-23-96.mc.videotron.ca [96.23.147.21]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 459671208CE; Mon, 31 Oct 2022 16:33:31 -0400 (EDT) In-Reply-To: <87zgdchto0.fsf@gmx.de> (Michael Albinus's message of "Mon, 31 Oct 2022 16:58:07 +0100") 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246721 Archived-At: > However, dbus.el is prepared to care this situation. It contains the code > > --8<---------------cut here---------------start------------->8--- > ;; The following symbols are defined in dbusbind.c. We need them also > ;; when Emacs is compiled without D-Bus support. > (unless (boundp 'dbus-error) > (define-error 'dbus-error "D-Bus error")) > > (unless (boundp 'dbus-debug) > (defvar dbus-debug nil)) > --8<---------------cut here---------------end--------------->8--- Hmm... this will define `dbus-debug` as a dynamically scoped variable when `dbus.el(c)` is *loaded* but not while compiling this file, so the compilation *should* arguably emit those warnings (and those relating the the places where we let-bind this var reflect real bugs because we'll miscompile those bindings as if they were using static scoping). So I think the code requires a top-level (defvar dbus-debug). > This has worked fine until recently. According to git bisect, the > following commit has broken this: > > --8<---------------cut here---------------start------------->8--- > 1b1ffe07897ebe06cf96ab423fad3cde9fd6c981 is the first bad commit I wonder why we didn't get warnings before that commit (and why this commit makes a difference). ... Oh, I see. The patch changed a bit how dynvars are recognized which fixed some cases where `defvar`s "leaked" outside of their context. The previous leak, in the present case, caused the `(defvar dbus-debug nil)` to mark that var as dyn-bound in the whole file rather than only within the `unless` where it appears. Admittedly, in this case it was the right call :-) Stefan