Subject: Re: CVS commit: syssrc
To: Charles M. Hannum <root@ihack.net>
From: Matthew Jacob <mjacob@feral.com>
List: source-changes
Date: 12/30/2000 11:47:53
Read my update. It is a bug somewher and not the code.
char *foo = "XXX"
is not
const char *foo = "XXX";
On Sat, 30 Dec 2000, Charles M. Hannum wrote:
>
> > There's a compiler bug for sparc64 that makes the construct:
> >
> > char *foo = "XXXX";
> > ...
> > foo[1] = 'Y';
> >
> > blow up (in the kernel) with the 2nd assignment. Work around it here-
> > it's probably just as well- I was spending more in cpu instructions doing
>
> This is *not* a bug. That initializer creates a string literal, which
> is a `const char *'. It gets stored in the text section. It `blows
> up' because you're trying to write to a read-only page. `Don't do
> that.'
>