This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
So you couldn't issue the above statement because TREE_STRING_POINTER's are not generally writable. Here, we know that it is safe because we just allocated the space for it a few lines above.
In order to write to it, you must cast away the const-ness, but doing so prompts warnings from -Wcast-qual, hence the need for the CONST_CAST().
memcpy (s->string.str, str, len); s->string.str[len] = '\0';
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |