From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: How to cause a compiler warning? Date: Tue, 16 Jan 2024 22:29:11 -0500 Message-ID: References: <871qak4n4h.fsf@gmail.com> <874jffsyfy.fsf@localhost> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33895"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 17 04:30:16 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rPwd5-0008cD-Po for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Jan 2024 04:30:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPwcE-0007UA-A2; Tue, 16 Jan 2024 22:29:22 -0500 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 1rPwc4-0007TQ-W4 for emacs-devel@gnu.org; Tue, 16 Jan 2024 22:29:14 -0500 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 1rPwc4-0000rK-4U; Tue, 16 Jan 2024 22:29:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=G0yybUC4T5+U/IaikANqWVtBGDu2rjCuVdKtrfj7ooM=; b=KCEumOznYDtm J4/Ysl3c9JVqOw19E8Ur7ovZA0781eQbK8vS3Aab1tNSxWejWv2GqrbiHP4E80zWlNQD8m1iZ/jbG 7O326VqD8+CUMEXU/o8NAicb/tZ7DEZ2t8u/walV6L7PLB9WZj2craPan/Bcz+wV9KXK+887mxl/K DNZVMW/BTQ/22rojj2xtWmZQ5Jd3wsqoS8rTbYtKBFxkbpHhguXxD0LLKGkTa1UtZUJITXwu5mo0P 7jth+czBl45/WHiKak2HhremJ02554jBK9fKwbU2lfhb+dCyKFF83QPQxdHB1Kfjg0xpcYUgskMnw QFqZbwZbdMevMl940bop2Q==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rPwc3-0000si-Cr; Tue, 16 Jan 2024 22:29:11 -0500 In-Reply-To: (message from Alan Mackenzie on Sun, 14 Jan 2024 16:26:59 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:315027 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] Thanks to all those who have posted answers. I've removed all but one of you (the one this is a direct reply to) from the CC so you won't get two copies. > > > Since 29.1, the correct function for a warning has been > > > byte-compile-warn-x. > > What about `macroexp-warn-and-return'? > It is a complicated way of calling byte-compile-warn-x. Since the warning would come from expansion of the cond* pacro, I get the impression from the doc string that `macroexp-warn-and-return' MAY be exactly what I want. But I can't br quite sure. `byte-compile-warn-x' has a feature of an argument (unhelpfully named ARG) which says, ARG is the source element (likely a symbol with position) central to the warning, intended to supply source position information. Does `macroexp-warn-and-return' have a similar feature? Does it use FORM for that? If so, it woukd be helpful for its doc string to say FORM will be used this way. With the current doc string it is not clear what it WILL do with FORM. Can someone please clarify these minor points so I can tell what to do? Also, it would be good to rename the argument ARG and improve the doc string as described above. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)