From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Towards a cleaner build Date: Fri, 17 May 2019 14:31:21 +0200 Message-ID: References: <831s0xd3z1.fsf@gnu.org> <83pnohbhny.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="260700"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii , Stefan Monnier , Emacs developers To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 17 14:33:48 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hRc3X-0015fn-KN for ged-emacs-devel@m.gmane.org; Fri, 17 May 2019 14:33:47 +0200 Original-Received: from localhost ([127.0.0.1]:47938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRc3W-0007VI-4Y for ged-emacs-devel@m.gmane.org; Fri, 17 May 2019 08:33:46 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRc3L-0007Uq-0L for emacs-devel@gnu.org; Fri, 17 May 2019 08:33:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRc1G-0004Qw-3R for emacs-devel@gnu.org; Fri, 17 May 2019 08:31:27 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:34270) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hRc1F-0004Pe-T3; Fri, 17 May 2019 08:31:26 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hRc1B-0002oL-J0; Fri, 17 May 2019 14:31:23 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEUNCAVLHBAHAwGQPyFj KRwTCwgLBwPTbiglEgt3NSBd8HceAAACaklEQVQ4jV2TTWvcMBCG1VCbPUbEAe+tLDTnFpkK32Ks kPjmi4KO7rbr0rMDorcKalBvCXZJ/W/zjrTZbPLixd55NB8aaZjxnFeZIlX04zz3kGbGRSvE90av IbbyDgZayX3USPaWJfiEkbtGNrOo9mbN2M4fKVhpeZuynXlrZqQTttPm2IrVr4B+WZwGsGUf9UFx cdp3XQqPA2B7pX2fHnuwA+j6vj94tO0R6HoWgPHHBCnIIwW4tn+V+nP+Arq+i0A+5HzMqX+hhyOa NrbB4wZf/tket3sLUFuFzmc3h+SIk9zuq2KvqkpTdgAvSqkAgA9t7BVL9ucTXwCrXE6DkLm0dlBD jmw4498o1+hJCCELYUGEisd+GkBdSzEUE1ysLedw9hGsAUTRTDDLYSgrkFP0aqXXCCUKVcNFCDwz zy9PkFw/wmCLX3UIVQpRzhXAxVdOwYfCogZ6c7UscwR1IHaQA3185utG3W/Zxc9yngJ4VoHrd7ll mx+2rK18BvQakDyA4dEKeQTs8LAHsc5gLCP+ghzfipLqBbxDwDI24BMln/kZmgQPhWYuahH4Rx7f q9wFIO9ob0XGr0Vxj32856NDDEEFUG8QQJSXKVrSJk5JNEWsiaDzTSPuCaQ7n9UCO18axMIzqYXA O5yM4w1SzmflVExixpj+a+loCWSLtEVdVirO6VVLHjkNblNOgkadJtXxKw0Pf+Ndbhw3Gc94hTVu 9AGMhmECcYPozrrRnBtvzjXrVmnbjUa7FnTUTq+80ZpAEq+xxp1GmJHTtcpGzfp+E4VpiUoSeAJs XqvH1Kz+A2w3b3XR7+DxBPI/QwRvgOyOAAAAAElFTkSuQmCC In-Reply-To: (Lars Ingebrigtsen's message of "Fri, 17 May 2019 13:34:41 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.231.51 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236658 Archived-At: I had a whack at suppressing warnings about obsolete functions being called from other obsolete functions, and it seems to work for my test case. A very similar case can be added for the advertised calling convention case, I think (where a function calls itself recursively with the "wrong" convention). If we want to go in this direction, I can finish it up and add some documentation... diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index e76baf5ed0..893171f4f5 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -337,12 +337,19 @@ byte-compile-warnings (or (symbolp v) (null (delq nil (mapcar (lambda (x) (not (symbolp x))) v)))))) -(defun byte-compile-warning-enabled-p (warning) +(defun byte-compile-warning-enabled-p (warning &optional symbol) "Return non-nil if WARNING is enabled, according to `byte-compile-warnings'." - (or (eq byte-compile-warnings t) - (if (eq (car byte-compile-warnings) 'not) - (not (memq warning byte-compile-warnings)) - (memq warning byte-compile-warnings)))) + ;; Don't issue a warning for SYMBOL being obsolete if called from + ;; within an obsolete function. + (and (not (and (eq warning 'obsolete) + byte-compile-current-form + (eq byte-compile-current-form symbol) + (get byte-compile-current-form 'byte-obsolete-info) + (not (memq symbol byte-compile-not-obsolete-funcs)))) + (or (eq byte-compile-warnings t) + (if (eq (car byte-compile-warnings) 'not) + (not (memq warning byte-compile-warnings)) + (memq warning byte-compile-warnings))))) ;;;###autoload (defun byte-compile-disable-warning (warning) @@ -1268,7 +1275,7 @@ byte-compile-warn (defun byte-compile-warn-obsolete (symbol) "Warn that SYMBOL (a variable or function) is obsolete." - (when (byte-compile-warning-enabled-p 'obsolete) + (when (byte-compile-warning-enabled-p 'obsolete symbol) (let* ((funcp (get symbol 'byte-obsolete-info)) (msg (macroexp--obsolete-warning symbol -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no