From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: How to cause a compiler warning? Date: Wed, 17 Jan 2024 13:40:04 +0000 Message-ID: References: <871qak4n4h.fsf@gmail.com> <87v87ve9i5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28273"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Richard Stallman , emacs-devel To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 17 14:41:14 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 1rQ6AL-0007BU-Ic for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Jan 2024 14:41:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQ69W-0000iO-6O; Wed, 17 Jan 2024 08:40: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 1rQ69U-0000hw-JL for emacs-devel@gnu.org; Wed, 17 Jan 2024 08:40:20 -0500 Original-Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQ69S-0005a2-UJ; Wed, 17 Jan 2024 08:40:20 -0500 Original-Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2cddb11b2e2so25490581fa.1; Wed, 17 Jan 2024 05:40:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705498816; x=1706103616; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uG24Yn1wQ+ijg/v/qj9M90zZzVzVAXdCspqUKC0p0+0=; b=l3lo66ipFuPx4QSlYfxAbrQmQZHx1M67+N5CYR0jcz3IDtlJ+9BmsvdX5sSXcUTwBm wH+wJWh6gn4xrx1bJOKhAPbGFpMHv1v+5zjVNCy0BSawB7LrCc7S8WZhY8hwX21x9tDR XgpAzAFClzcEuGXqnA5/XO+If86i5e5I8i93KKhkw4GIL/r+/3mzjl+y0wX12kuJV8Kx HwadqHqfhEsPXX7eT200ZRDAQxoEtjlCZiJ3AnlgcSwuhDOu4wggjQuSIx7jqB40NHD1 12MOIEdRJY4hjeor7WrI0oLiE+Ms1CGzDXHpc5LNTAlGR5GwJz35U9cK5upSoeKfe5c4 AD9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705498816; x=1706103616; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uG24Yn1wQ+ijg/v/qj9M90zZzVzVAXdCspqUKC0p0+0=; b=EnUTYxvCy6pqRfT5KAo3NjyarVzJVwGDJ+4kz3VYw+bYlIz2uvvDhtB7dfryIyg8Ss yEmRJ+6Vl4M8NaFn6IuVVu6txWWyKR+hSm4/PqhZhqtXb17SMW1nRZ3vwGDiL2zxzva9 vGpneMJtf1gIRrq+6t1ghDcl1Wep8ojBC7p7NwZIIr11zSeMLQjvgwqbka2PgNGbvCUx JrVzpfYiw+oQxineFKbJKv/l7MJwv4oyg1GnuB/PkMnYYocyCzIzKZE5hwjfk9sZKBH0 CsID3zd9tQ7dS2N+3u9WtbIOEfvjEHbYi+bQ+vaVMTuqzdlzvrrqqXnoCUO2e0K9nhwM LumA== X-Gm-Message-State: AOJu0YyBbUvBGrVE3tSK/vhs+mxpDMsC1VxQlVCwo8R+xamF9/eDycXY 5nMwGxSssxUxoaL/ITcPYtvDmFMJ+4xFbTM79ck= X-Google-Smtp-Source: AGHT+IGq8oAMOnOe7Iu/M6pZZNHq5pQGYWQA+2wKr3lzsJyrcf2TNPjZCR3h+GZKuOvAL5AkuEyQ7jggmi1wWGxx7nI= X-Received: by 2002:a2e:a261:0:b0:2cd:ca8f:20f1 with SMTP id k1-20020a2ea261000000b002cdca8f20f1mr2637110ljm.1.1705498815977; Wed, 17 Jan 2024 05:40:15 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=joaotavora@gmail.com; helo=mail-lj1-x233.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:315038 Archived-At: On Wed, Jan 17, 2024 at 12:25=E2=80=AFPM Alan Mackenzie wrote: > ARG can be any Lisp form at all. How would you reformulate the doc > string to make it less vague and curious? Call it FORM. Then add in the text you wrote to Richard, who seem to have also been confused. I got the idea of it pretty quickly, even with the ARG naming, so take that as a data point. > Really? Can you point out any such existing macro in the source files > of the byte compiler? You must be aware that warning messages without > source code locations are annoying in the extreme. Not all macros process forms. Just search for a macro without arguments. > source code locations are annoying in the extreme. That's a bit of an extreme statement. Macros that don't process source code and are used simply to generate Lisp code don't have anything else to report. So using byte-compiler-warn is fine and you'll see the macro invocation itself highlighted. > byte-compile-warn-x is intended for use in the byte compiler. Anybody > doing work there should be sophisticated enough to understand what to > do. In macros which extend the Lisp language, there is > macroexp-warn-and-return, for anybody who can understand it. Do people > actually write such language extensions and expect them to work on old > Emacs versions? There may be, but I'm not aware of any. I write macros that are supposed to work back to Emacs 26 yes. I frequently don't bother with byte-compiler-errors as I tend to let the other macros and special forms my macro expands to do that. But not necessarily always. My point is you shouldn't make this a hard rule with such dogmatism But it was fine to suggest byte-compile-warn-x, which I didn't know about, so thanks.