emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs rewrite in a maintainable language


From: Alan Mackenzie
Subject: Re: Emacs rewrite in a maintainable language
Date: Tue, 13 Oct 2015 12:21:20 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

Hello, Oleh.

On Tue, Oct 13, 2015 at 02:02:48PM +0200, Oleh Krehel wrote:
> Alan Mackenzie <address@hidden> writes:

> > 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".

Yes, you're right.  Sorry about that.  It's one of the few flaws in C's
syntax that there are here two confusing ways of writing the same thing.

> 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 *".

No disagreement here.  But the deprecated form will keep creeping back,
over the coming years.

>     Oleh

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]