This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/35384] Variables declared as 'static char * avar = "some string";' cannot be modified
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Feb 2008 21:09:58 -0000
- Subject: [Bug c/35384] Variables declared as 'static char * avar = "some string";' cannot be modified
- References: <bug-35384-15831@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from pinskia at gcc dot gnu dot org 2008-02-26 21:09 -------
>Converting avar from a pointer to an array like
this however does work:
static char avar[] = {"some string"};
This is an array value which is initialized via a string literal. The array is
writable.
The behavior is still undefined for writing in string literals.
-- Pinski
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35384