Removing -frwitable-strings
Joe Buck
Joe.Buck@synopsys.COM
Thu Dec 18 21:37:00 GMT 2003
On Thu, Dec 18, 2003 at 11:02:06AM -0800, Mark Mitchell wrote:
> On Thu, 2003-12-18 at 10:57, Jamie Lokier wrote:
> > Someone said that -fwritable-strings could be implemented in the front
> > end, but currently it isn't and that adds unwanted code to
> > the back end.
> >
> > Perhaps it's quite a simple change to make string constants have type
> > "char[]" in the C and C++ front ends instead of "const char[]"? (No,
> > I'm not volunteering).
>
> It ain't that easy, sadly.
It would seem that the front end would need to generate a static
char[] array for each literal string, and use its address as the value
of the literal string expression. If that were done, the back end could
eliminate its support for -fwritable-strings.
More information about the Gcc
mailing list