This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Compiling GCC With a C++ Compiler (g++)
On Wed, 13 Oct 2004 11:19:24 +0530, Ranjit Mathew <rmathew@gmail.com> wrote:
>
> In this particular case, we can probably resolve this
> issue by removing "const" from tree_string but adding
> "(const char *)" to the definition of TREE_STRING_POINTER
> so that for "properly behaving" clients of a STRING_CST,
> it is still a constant.
Like so:
Index: tree.h
===================================================================
--- tree.h 2004-10-13 11:34:28.000000000 +0530
+++ tree.h 2004-10-13 12:22:45.000000000 +0530
@@ -1060,13 +1060,14 @@ struct tree_real_cst GTY(())
/* In a STRING_CST */
#define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length)
-#define TREE_STRING_POINTER(NODE) (STRING_CST_CHECK (NODE)->string.str)
+#define TREE_STRING_POINTER(NODE) \
+ ((const char *)(STRING_CST_CHECK (NODE)->string.str))
struct tree_string GTY(())
{
struct tree_common common;
int length;
- const char str[1];
+ char str[1];
};
/* In a COMPLEX_CST node. */