Deutsch   English   Français   Italiano  
<v8iood$2rhnh$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: James Kuyper <jameskuyper@alumni.caltech.edu>
Newsgroups: comp.lang.c
Subject: Re: No warning at implicit removal of const. Was: relearning C: why
 does an in-place change to a char* segfault?
Date: Fri, 2 Aug 2024 09:59:40 -0400
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <v8iood$2rhnh$1@dont-email.me>
References: <IoGcndcJ1Zm83zb7nZ2dnZfqnPWdnZ2d@brightview.co.uk>
 <20240801174026.00002cda@yahoo.com> <v8gi7i$29iu1$1@dont-email.me>
 <slrnvaorkl.34j6.candycanearter07@candydeb.host.invalid>
 <87zfpvfdk4.fsf@nosuchdomain.example.com> <v8ii17$2q5p1$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 02 Aug 2024 15:59:42 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="fc09beaaa05891c9bcdd65835817b51b";
	logging-data="3000049"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX190AmugpReRtMR/uvQnHBUMopge+8UvK94="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:4FsC8zgNqSA5BGGk/9RHVCFqH7k=
In-Reply-To: <v8ii17$2q5p1$1@dont-email.me>
Content-Language: en-US
Bytes: 1748

On 8/2/24 08:04, Richard Harnden wrote:
....
> Is there any reason not to always write ...
>
> static const char *s = "hello, world";
>
> ... ?
>
> You get all the warnings for free that way.

If you hate being notified of the errors that can be caught by
appropriate use of 'const', as many do, that can be considered a
disadvantage. I can't claim to understand why they feel that way, but
such people do exist.