From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sergey Organov Newsgroups: gmane.emacs.devel Subject: Re: [C source] Inconsistent comments on preprocessor conditionals Date: Fri, 08 Jul 2022 19:28:44 +0300 Message-ID: <87zghj7emb.fsf@osv.gnss.ru> References: <87sfnb3h5m.fsf@disroot.org> <8335fb4vc7.fsf@gnu.org> <6feb2ce2c5e249b74e836edd3ba0c7a0@webmail.orcon.net.nz> <83y1x33eum.fsf@gnu.org> <875yk73e12.fsf@disroot.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26162"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , Phil Sainty , emacs-devel@gnu.org To: Akib Azmain Turja Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 08 19:31:04 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 1o9rom-0006eM-Ca for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Jul 2022 19:31:04 +0200 Original-Received: from localhost ([::1]:33456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9rok-0001L3-Kh for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Jul 2022 13:31:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9qqZ-0004i7-9O for emacs-devel@gnu.org; Fri, 08 Jul 2022 12:28:51 -0400 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:44821) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9qqX-0001bh-JB; Fri, 08 Jul 2022 12:28:50 -0400 Original-Received: by mail-lf1-x12a.google.com with SMTP id e20so8426816lfq.11; Fri, 08 Jul 2022 09:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=T4Xuv8Oz7847O3ZflF6pK+RcmpUj4nL/t5Fjj8VKhHQ=; b=Fehbc6A8KUe5V7btAUfpmF2D3X6kO6CTnWcGWsrUv8d4Tz8SQSr6LOf1YyP6u/1Jsm ufOOckqvEgH75jrX5HSuwq1Qbu9FzQcAlGNKhPkM0j1aA18PctKMBskf7XKMHyUq99Wp RrDJ2+8Vq1YX8zEoGjkkqdhlYeF2eYq/sJYzAnYiPmKf9AQmw6prjL5cLi4njzRmRnFx DhbdG+FjIvada9uEcqI7a9lNxXOZAtyw7L97MEtyQ9idtIv7lxWC31Rx6dWLWNgevsyj 9EsamzJECvxyzt2XYuCVXeFwFaMHBrgG52RUNyhlOgBNWvxspJZOTq6XgFO2C2AGZMhm agvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=T4Xuv8Oz7847O3ZflF6pK+RcmpUj4nL/t5Fjj8VKhHQ=; b=iQgx2OgDs6DPWQJqHGVQRtLmyMjliyRMkqw6t/cXjnMvgBO/7+2pxZ2fPRuMuipZmf TrupoX75ZmtJVb1RQVl2xmihTHpaY6rVtpPcidlxrLPYkvxA+zYn2qfz3e0THuxsjar/ OwuJ75yksIxCfAAXYqBfU1TiIo4uLV/SobcFdO9lXZqTU000DQlqiuYPhyu1QJuaoXu2 R+Yfredf8MEks0YJqxX3n4A9i+y29UiRxPzV8kAuMAT/jh9aoFcxg+rtLFONl8OBhxYf 35XphBLUoRKnPE44O47dgx2VX+HaRQbWn45N6CS6K8fSxeL7EyE8F/tR1AJAbncBlhA9 Lspg== X-Gm-Message-State: AJIora9ssXn+y+42O1xUDhEsNHXvdn8rGmRGW+Y+ImOKLFlneqyhg7/K qoEoSRNujPFaL95REZeOrR8NwRENp14= X-Google-Smtp-Source: AGRyM1v46GKCCog9Xkm01iH3A+1drEjXn93PfIxTRn9Fxk0lD1zg7p3dfVnftNag0wV9d/Vgq6sDQg== X-Received: by 2002:a05:6512:3608:b0:47f:6c47:241e with SMTP id f8-20020a056512360800b0047f6c47241emr2763339lfs.269.1657297726488; Fri, 08 Jul 2022 09:28:46 -0700 (PDT) Original-Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id n24-20020a05651203f800b0047863e5649esm7523480lfq.86.2022.07.08.09.28.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 09:28:45 -0700 (PDT) In-Reply-To: <875yk73e12.fsf@disroot.org> (Akib Azmain Turja's message of "Fri, 08 Jul 2022 19:55:05 +0600") Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=sorganov@gmail.com; helo=mail-lf1-x12a.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" Xref: news.gmane.io gmane.emacs.devel:291974 Archived-At: Akib Azmain Turja writes: > Eli Zaretskii writes: > >>> Date: Sat, 09 Jul 2022 01:33:26 +1200 >>> From: Phil Sainty >>> Cc: Akib Azmain Turja , emacs-devel@gnu.org >>> >>> On 2022-07-09 00:55, Eli Zaretskii wrote: >>> > You mean, the comment for the #endif line? It doesn't really matter >>> > how you comment that, because both comments tell the same: the >>> > #ifdef'ed conditional block ends here. The differences in this case >>> > are purely stylistic. >>> >>> The "#endif /* not FOO */" version provides the extra information that >>> there *is* an "#else" clause >> >> No, it doesn't, because the conditional could start with #ifndef >> instead. > > Then we can do like the following: > > #ifndef FOO > ... > #else /* not !FOO */ > ... > #endif /* not !FOO */ It should then rather be something like: #ifndef FOO #else /* not ndef FOO */ #endif /* not ndef FOO */ as there also could be: #if !FOO #else /* not !FOO */ #endif /* not !FOO */ >From that POV, the original should better be: #ifdef FOO #else /* not def FOO */ #endif /* not def FOO */ to tell it from: #if FOO #else /* not FOO */ #endif /* not FOO */ Just for mentioning, for myself I've adopted shorter style: #ifdef FOO #else /*! def FOO */ #endif /*! def FOO */ where "/*!" reads like a specific single token clearly separate from the #if condition, thus avoiding confusion. -- Sergey Organov