From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sergey Organov Newsgroups: gmane.emacs.devel Subject: Re: Emacs rewrite in a maintainable language Date: Tue, 13 Oct 2015 16:06:08 +0300 Message-ID: References: <561A19AB.5060001@cumego.com> <87io6dl0h0.fsf@wanadoo.es> <87lhb82qxc.fsf@gmail.com> <878u78b3hg.fsf@fencepost.gnu.org> <87h9lwyv33.fsf@gmail.com> <561C368F.6010306@cs.ucla.edu> <87oag3xb2i.fsf@gmail.com> <20151013114630.GA4613@acm.fritz.box> <87io6bou1j.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444741686 32016 80.91.229.3 (13 Oct 2015 13:08:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Oct 2015 13:08:06 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 13 15:07:57 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZlzJ6-0000Ix-PR for ged-emacs-devel@m.gmane.org; Tue, 13 Oct 2015 15:07:57 +0200 Original-Received: from localhost ([::1]:34537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlzJ6-00047k-09 for ged-emacs-devel@m.gmane.org; Tue, 13 Oct 2015 09:07:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlzHe-0002G7-Kp for emacs-devel@gnu.org; Tue, 13 Oct 2015 09:06:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlzHb-0006Bs-PT for emacs-devel@gnu.org; Tue, 13 Oct 2015 09:06:26 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:51313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlzHb-0006BJ-I9 for emacs-devel@gnu.org; Tue, 13 Oct 2015 09:06:23 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZlzHY-0007L8-Sl for emacs-devel@gnu.org; Tue, 13 Oct 2015 15:06:20 +0200 Original-Received: from 89.175.180.246 ([89.175.180.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 13 Oct 2015 15:06:20 +0200 Original-Received: from sorganov by 89.175.180.246 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 13 Oct 2015 15:06:20 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 89.175.180.246 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:191454 Archived-At: Oleh Krehel writes: > Alan Mackenzie writes: > >> Hello, Oleh. >> >> On Tue, Oct 13, 2015 at 01:27:49PM +0200, Oleh Krehel wrote: >> >>> May I ask if there's a reason to not have a single style for const >>> pointers? I get 2162 occurrences of "const char *", and 357 occurrences >>> of "char const *" in the C sources. >> >> Yes there is. The two are semantically different. In one of them, it is >> the pointer which is declared constant. In the other, it's what's >> pointed at that's constant. Though I can never remember which is which. >> :-( > > Hi Alan, > > Actually, "const char *" and "char const *" are absolutely equivalent in > all regards, both in C and C++. > > I think you meant the difference between "const char *" and "char * const". > > For exactly this reason (the confusion over 3 notations, 2 of which are > the same), I propose that we stick only to "const char *" and "char * const", > and don't use "char const *". People write "char const *" because it uses the general and simple rule "'const' applies to what is to the left", that makes it easy to figure what "char * const" means and why ('const' applies to '*' here, to the pointer). OTOH, "const char *", while looks more "natural", relies on additional rule "when nothing is to the left, 'const' applies to what is to the right". Dunno if enforcing one form or another makes sense. -- Sergey.