Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c > #6147

Re: Making the element type of string literals const

From Florian Weimer <fw@deneb.enyo.de>
Newsgroups comp.std.c
Subject Re: Making the element type of string literals const
Date 2020-08-14 23:41 +0200
Message-ID <877du0oqgv.fsf@mid.deneb.enyo.de> (permalink)
References <rh5lrt$m1k$1@solani.org> <rh5td1$pb1$1@dont-email.me>

Show all headers | View raw


* David Brown:

> The best alternative is to have it as a compiler switch.  gcc's
> "-fwrite-strings" option does exactly this, and I use it in my own code.
>  (I disagree with the naming - as it affects the semantics of the
> language, it should not be a "warning" option - but that's another matter.)

The historic -fwritable-strings option actually made string literals
writable by placing them into the data segment.

Back to comp.std.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Making the element type of string literals const Philipp Klaus Krause <pkk@spth.de> - 2020-08-14 11:34 +0200
  Re: Making the element type of string literals const David Brown <david.brown@hesbynett.no> - 2020-08-14 13:43 +0200
    Re: Making the element type of string literals const Florian Weimer <fw@deneb.enyo.de> - 2020-08-14 23:41 +0200
      Re: Making the element type of string literals const David Brown <david.brown@hesbynett.no> - 2020-08-17 15:23 +0200

csiph-web