Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: does char *str="abcd"; alloc addressable memory? Date: Fri, 10 Jul 2020 08:54:52 -0700 Organization: A noiseless patient Spider Lines: 29 Message-ID: <86365zfjqr.fsf@linuxsc.com> References: <87k0zgbiwt.fsf@nosuchdomain.example.com> <6HCNG.37756$bQ4.31924@fx04.iad> <86fta0fw7j.fsf@linuxsc.com> <87o8oo8s31.fsf@nosuchdomain.example.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="f3890fc58619ed0f56304a9e18958149"; logging-data="23697"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+w2GqHmiGNg/RKlk9QXQtKZmkgFrxB/Tw=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:HLRPBcnDxmfBod81b9fvF1n/m+k= sha1:kCHQ0uwWUM3SArqZciJDq4KRdu4= Xref: csiph.com comp.lang.c:153181 John Forkosh writes: > Keith Thompson wrote: > >> Tim Rentsch writes: >> [...] >> >>> Much more recently than that, gcc had an option -fwriteable-strings. >>> That option has since been removed, but it was still available in >>> the last ten years or so. >> >> The "-fwritable-strings" option (note spelling), was removed in 2004. >> The version string for the commit that removed it was >> "3.5.0 20040223 (experimental)". > > Just curious at this point (since you and TimR and BenB already > elegantly solved my actual problem upthread), but why would the > behavior be removed at all? [...] My guess is it was a simple cost/benefits analysis. Here is a compiler (not language!) feature that is of dubious utility, probably not used very much, and requiring further investment of effort to support for new OS releases, changes to object file formats, etc. It isn't surprising that gcc developers might decide their efforts were better spent elsewhere - just yank the thing and be done with it, especially since there are easy and obvious workarounds, and even easier given that support for compound literals in C99 had been around for five years at that point.