From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#35062: [PATCH v3 2/3] constify a bit of xterm.c Date: Sat, 13 Apr 2019 14:36:38 +0300 Message-ID: <83tvf2jfw9.fsf@gnu.org> References: <20190407021331.948-1-Hi-Angel@yandex.ru> <20190407021331.948-2-Hi-Angel@yandex.ru> <1555155046.2588.0@yandex.ru> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="109382"; mail-complaints-to="usenet@blaine.gmane.org" Cc: eggert@cs.ucla.edu, 35062@debbugs.gnu.org To: Konstantin Kharlamov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 13 13:37:16 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1hFGyC-000SLj-4P for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Apr 2019 13:37:16 +0200 Original-Received: from localhost ([127.0.0.1]:50381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFGyA-00056B-RC for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Apr 2019 07:37:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFGxz-00054k-S1 for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2019 07:37:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFGxy-00028s-UN for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2019 07:37:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44730) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hFGxy-00028P-NG for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2019 07:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hFGxy-0004z9-Fz for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2019 07:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Apr 2019 11:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35062 X-GNU-PR-Package: emacs Original-Received: via spool by 35062-submit@debbugs.gnu.org id=B35062.155515542119156 (code B ref 35062); Sat, 13 Apr 2019 11:37:02 +0000 Original-Received: (at 35062) by debbugs.gnu.org; 13 Apr 2019 11:37:01 +0000 Original-Received: from localhost ([127.0.0.1]:58274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hFGxw-0004yu-KZ for submit@debbugs.gnu.org; Sat, 13 Apr 2019 07:37:00 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hFGxt-0004yg-Tf for 35062@debbugs.gnu.org; Sat, 13 Apr 2019 07:36:59 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFGxo-0001sG-9x; Sat, 13 Apr 2019 07:36:52 -0400 Original-Received: from [176.228.60.248] (port=1474 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hFGxn-00043c-5B; Sat, 13 Apr 2019 07:36:52 -0400 In-reply-to: <1555155046.2588.0@yandex.ru> (message from Konstantin Kharlamov on Sat, 13 Apr 2019 14:30:46 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:157581 Archived-At: > Date: Sat, 13 Apr 2019 14:30:46 +0300 > From: Konstantin Kharlamov > Cc: Paul Eggert , 35062@debbugs.gnu.org > > I'd like to take this as an opportunity to ask a question: I see Emacs > C code is using the old style where variables (mostly) are declared at > the beginning of a function. Is it just a legacy from C89 days (I hope > so), or is it a mandatory style? It's legacy. Nowadays we allow declarations near the first usage, per C99. But again, we only make changes in the order as part of other code changes, not just by themselves. > I'm asking because if I gonna work on the code, I'd for sure like to > encapsulate variables as much as possible, which means I'd rather > declare them on the first use (as a bonus, this often may allow to > constify the variable too). That's okay. We require C99 these days.