Subject: Re: bug#40671: [DOC] modify literal objects

From: Paul Eggert <[email-masked]>
Date: Fri, 24 Apr 2020 20:20:08 -0700

On 4/24/20 7:40 PM, Dmitry Gutov wrote:
>> That depends on what other programming languages we're talking about. The
>> current use of 'constant' in the manual corresponds reasonably closely to
>> 'const' objects in C and C++.
> 
> Since we're talking about non-scalar values, do you mean constant pointers to
> (generally) mutable objects? Or a constant aggregate of mutable objects?

Neither. I mean a constant object, e.g., the array of chars denoted by the
string literal "abc" in C.

> When a value is constant in C or C++, you can't change it.

Yes, you can't change it in a portable program, because if you attempt to change
it the resulting behavior is undefined. The attempt might succeed so that the
"constant" is changed, or you might get a core dump, or you might get an
exception, or something else might happen.