Subject: Re: Crossbuilding broken with GCC4.
To: Kentaro A. Kurahone <kurahone@sigusr1.org>
From: Roland Illig <rillig@NetBSD.org>
List: tech-toolchain
Date: 09/23/2005 01:16:27
Kentaro A. Kurahone wrote:
> Hi,
> 
> Due to various twists of fate, I'm trying to bootstrap netbsd from a
> Linux host.  The distribution in question is Fedora core 4, which has
> GCC 4.0.0 as the system compiler.
> 
> Because it got slightly more pedantic, the gcc-3.3.3 that we ship with
> does not build (at least didn't last I tried this).  The main issue is
> ?: as a l-value.
> 
> 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
> 
> Thoughs?

I would use

   #if 0 /* $reason */
       old_code();
   #else
   #endif

instead of

   /* old_code(); */.

The most important thing about it is the $reason. I am no gcc guru, so 
it would help me a lot seeing an explaining comment around the change. :)

Roland