se7en_hills wrote:
> Hello,
> I have built GCC 4.2.1 on fedora 8 and i tried installing GCC 3.2.3 on
> the same OS. But after configuration it shows an error while building. It
> shows the error in the code like,
>
> error in function regex.c : line no 662 lvalue required for
> incrementing operand.
>
> I dont understand whether the probl is with the code or with building. Can i
> build the lower versions while the higher versions are being installed.?
It's because of a change in the languge gcc supports. If you tell us
the exact error, we can tell you how to fix it. I've appended the changes I
needed to build gcc-3_2-branch.
Don't build 3.2.1. Build 3.2.3; the only difference is bug fixes.
Andrew.
Index: read-rtl.c
===================================================================
--- read-rtl.c (revision 131336)
+++ read-rtl.c (working copy)
@@ -659,7 +659,7 @@
{
ungetc (c, infile);
list_counter++;
- obstack_ptr_grow (&vector_stack, (PTR) read_rtx (infile));
+ obstack_ptr_grow (&vector_stack, read_rtx (infile));
}
if (list_counter > 0)
{
Index: system.h
===================================================================
--- system.h (revision 131336)
+++ system.h (working copy)
@@ -578,6 +578,7 @@
#define really_call_calloc calloc
#define really_call_realloc realloc
+
#if (GCC_VERSION >= 3000)
/* Note autoconf checks for prototype declarations and includes
@@ -589,7 +590,9 @@
#undef realloc
#undef calloc
#undef strdup
+#if ! (defined(FLEX_SCANNER) || defined(YYBISON) || defined(YYBYACC))
#pragma GCC poison malloc realloc calloc strdup
+#endif
/* Old target macros that have moved to the target hooks structure. */
#pragma GCC poison ASM_OPEN_PAREN ASM_CLOSE_PAREN \
@@ -628,4 +631,11 @@
#endif /* GCC >= 3.0 */
+#if defined(FLEX_SCANNER) || defined(YYBISON) || defined(YYBYACC)
+/* Flex and bison use malloc and realloc. Yuk. Note that this means
+ really_call_* cannot be used in a .l or .y file. */
+#define malloc xmalloc
+#define realloc xrealloc
+#endif
+
#endif /* ! GCC_SYSTEM_H */