From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [C source] Inconsistent comments on preprocessor conditionals Date: Fri, 08 Jul 2022 15:54:33 -0400 Message-ID: References: <87sfnb3h5m.fsf@disroot.org> <8335fb4vc7.fsf@gnu.org> <6feb2ce2c5e249b74e836edd3ba0c7a0@webmail.orcon.net.nz> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3004"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Eli Zaretskii , Akib Azmain Turja , emacs-devel@gnu.org To: Phil Sainty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 08 21:56:29 2022 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 1o9u5U-0000bb-Mx for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Jul 2022 21:56:28 +0200 Original-Received: from localhost ([::1]:58302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9u5T-0005qp-G8 for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Jul 2022 15:56:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9u3p-0004TJ-3O for emacs-devel@gnu.org; Fri, 08 Jul 2022 15:54:46 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:45177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9u3m-0002xY-N1; Fri, 08 Jul 2022 15:54:43 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 37123100169; Fri, 8 Jul 2022 15:54:40 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7E8DD10012C; Fri, 8 Jul 2022 15:54:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1657310074; bh=30I9+2cTrul9plWofwHWDyvtWjJ4PHs73w+KabxE+mM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=cM483dqz0JM4WoiO2sqf99+rsFdCb1nulzIL+/R+FNYrbB/R0OLbYmX8bf3DGTJfQ 98ESIpWouzBhnW2njFTP/v1WuT4HO5WEYmv1ouFOgI2rTsi4E2qeE8u0Vthsa/TYLR Dxp5oB0sz/W+GL7cRrvQY40hDg9Dr92PegGgspdVykqj3uM6YrbwWnb59bPdYre8jH 8meJ9OMGsRUkRc1256RMu55druA8tzNQ2cbm2Gt5pcLK4ovoHkYxerDIDYSNOhOeJH vvT2EWMRtwuHiY7XbGZPNi+nrtyFSLWeAdW/fB148f/E6HWJxkBTZsRiVhcD7r3VJk Kmth7t10Ep0oA== Original-Received: from alfajor (unknown [45.72.196.165]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4871E12027C; Fri, 8 Jul 2022 15:54:34 -0400 (EDT) In-Reply-To: <6feb2ce2c5e249b74e836edd3ba0c7a0@webmail.orcon.net.nz> (Phil Sainty's message of "Sat, 09 Jul 2022 01:33:26 +1200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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" Xref: news.gmane.io gmane.emacs.devel:291977 Archived-At: > The "#endif /* not FOO */" version provides the extra information that > there *is* an "#else" clause -- which might be helpful if the clauses > are spaced very far apart. If "#endif /* FOO */" is then consistently > used only for cases with no "#else", some code may be (very) slightly > easier for people to parse. FWIW, I personally never trust whether the comment is positive or negative; instead the comment only tells me that it's the else/endif that matches the condition that has to do with FOO (as opposed to some other `#if` that tests something different), so the presence/absence of `not` doesn't make much difference for me. Maybe it's because of a lack of a clear and religiously followed convention. Also, those comments tend to get out of sync with the code, of course. IOW, I'd rather not have those comments and let Emacs generate that info dynamically, so it's always up-to-date and reliable. Stefan