summaryrefslogtreecommitdiff
blob: 2bdd26df4e396c97ae437ee9c39aa2b9b884af84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
fix building gcc-3.2.3 with newer versions of gcc

http://bugs.gentoo.org/225743
http://gcc.gnu.org/ml/gcc-help/2008-01/msg00040.html
http://www.archivum.info/gnu.gcc.help/2008-05/msg00093.html

--- gcc-3.2.3/gcc/read-rtl.c
+++ gcc-3.2.3/gcc/read-rtl.c
@@ -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)
 	    {
--- gcc-3.2.3/gcc/system.h
+++ gcc-3.2.3/gcc/system.h
@@ -589,7 +589,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 +630,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 */