Subject: Re: Crossbuilding broken with GCC4.
To: None <tech-toolchain@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: tech-toolchain
Date: 09/23/2005 08:48:22
On Thu, 22 Sep 2005, Kentaro A. Kurahone wrote:
> The following diff seems to fix things, though I haven't exercised the
> compiler enough to make sure that code generated is sane[0].
> 
> http://www.sigusr1.org/~kurahone/misc-hacks/gcc-3.3.3-ansi-fix.diff

Instead of trying to avoid using current_binding_level in an lvalue
context, why not just define it in a way that can be used in an lvalue
context?  Like this:

Index: gnu/dist/gcc/gcc/cp/decl.c
--- gnu/dist/gcc/gcc/cp/decl.c	10 Feb 2004 12:09:50 -0000	1.1.1.4
+++ gnu/dist/gcc/gcc/cp/decl.c	23 Sep 2005 06:45:06 -0000
@@ -674,8 +674,8 @@ struct cp_binding_level GTY(())
 
 #define current_binding_level			\
   (cfun && cp_function_chain->bindings		\
-   ? cp_function_chain->bindings		\
-   : scope_chain->bindings)
+   ? cp_function_chain				\
+   : scope_chain)->bindings
 
 /* The binding level of the current class, if any.  */
 

--apb (Alan Barrett)