From: Alex Pilosov <apilos01@utopia.poly.edu>
To: AXP-List <axp-list@redhat.com>
Subject: Re: More Apps porting to Alpha
Date: Tue, 10 Nov 1998 00:34:45 -0500 (EST) [thread overview]
Message-ID: <Pine.GSO.3.96.981110002940.28688B-100000@utopia.poly.edu> (raw)
In-Reply-To: <3647BE4B.2DC89988@msa.dec.com>
Actually what happens is that alpha is defined by egcs config files to 1,
which (of course) makes your stuff crap out. do gcc -E test.c and see the
result. Solution is easy: just add -Ualpha flag to cc line/CFLAGS and it
would disable that behaviour. Of course, it'd also kill any stuff that
tries to do special behaviour on alpha, but I guess there isn't any in WM.
-alex
On Tue, 10 Nov 1998, Wai-Sun Chia wrote:
> To anyone who tried to build WindowMaker on Alpha-Linux and failed, just
> so that you feel better, you're not alone!
>
> Actually, after a couple of hours of investigation and confirmation,
> here's my result:
>
> Kernel: v2.1.125
> Egcs: 1.1b
> OS: RedHat 5.1, 5.2
>
> Apparently EGCS craps out when a variable is defined as the arch name:
> i.e. alpha, i386, arm, m68k, mips, ppc, sparc, sparc64
>
> I've confirmed it with i386 and alpha. To test yourself, try to compile
> the following simple program:
>
> ******************** try.c *********************
> #include <stdio.h>
>
> int main()
> {
> int alpha = 1;
> printf("alpha = %d\n", alpha);
> return 0;
> }
> ************************************************
> You will get a "parse error before `1'". If you change alpha to nalpha
> or beta or anything other than alpha, then it'll work!!!
>
> Furthermore, if you s/alpha/i386/g in an Intel Linux box, guess what?
> Same problem!!!
>
> Perhaps the GCC/EGCS developers think that any programmer which defines
> a variable with the name as "i386" ought to be shot, but "alpha" is a
> pretty common variable. This is especially so in the graphics world
> where there is such a thing as an alpha-channel: in fact if you were to
> do a recursive grep in the WindowMaker sources, you'd be swamped!
>
> At first, I tried to rename the alpha variables to something else one by
> one, after the 10th file in the first subdirectory, I gave up. I tried
> to be smart and put this is the WindowMaker's system header file,
> "wraster.h" (this is WindowMaker 0.20.2):
>
> #define alpha wmalpha
>
>
> And voila! WM compiles OK! albeit tons and tons of warning messages, it
> runs too! But the graphics (icons and colors) and totally kaput!
> Apparently my "smart hack" changed the semantics of the system.... :-(
>
> This is what I see our options:
> 1. Make sure _ALL_ apps don't use arch names as variables (if
> cross-platform is important)
> 2. Ask politely GCC/EGCS developers to kindly remove this constraint
> from the compilers.
>
> I haven't sent any emails to neither GCC/EGCS nor WindowMaker
> developers. Want to see what other people think...
>
> BTW, libpng also suffers from this "alpha" variable syndrome....
>
>
> --
> Wai-Sun
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
>
next prev parent reply other threads:[~1998-11-10 5:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-11-10 4:17 More Apps porting to Alpha Wai-Sun Chia
1998-11-10 5:21 ` B. James Phillippe
1998-11-10 5:27 ` Peter Petrakis
1998-11-10 8:26 ` Wai-Sun Chia
1998-11-10 5:27 ` Peter Petrakis
1998-11-10 8:50 ` philb
1998-11-10 5:34 ` Alex Pilosov [this message]
1998-11-10 8:16 ` Wai-Sun Chia
1998-11-10 7:56 ` Peter Rye
1998-11-10 10:06 ` Wai-Sun Chia
1998-11-10 12:51 ` Paul Tomblin
1998-11-10 13:59 ` Alvin Starr
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox