From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 550 invoked from network); 10 Nov 1998 10:00:30 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 10 Nov 1998 10:00:30 -0000 Received: from picu-sgh.demon.co.uk (qmailr@picu-sgh.demon.co.uk [194.222.182.163]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id EAA15188 for ; Tue, 10 Nov 1998 04:45:27 -0500 Received: (qmail 8801 invoked by uid 500); 10 Nov 1998 07:56:18 -0000 Date: 10 Nov 1998 07:56:18 -0000 Message-ID: <19981110075618.8800.qmail@picu-sgh.demon.co.uk> From: Peter Rye To: axp-list@redhat.com In-reply-to: <3647BE4B.2DC89988@msa.dec.com> (message from Wai-Sun Chia on Tue, 10 Nov 1998 12:17:15 +0800) Subject: Re: More Apps porting to Alpha References: <3647BE4B.2DC89988@msa.dec.com> >>>>> "Wai-Sun" == Wai-Sun Chia writes: Wai-Sun> To anyone who tried to build WindowMaker on Alpha-Linux and Wai-Sun> failed, just so that you feel better, you're not alone! Wai-Sun> Actually, after a couple of hours of investigation and Wai-Sun> confirmation, here's my result: Wai-Sun> Kernel: v2.1.125 Egcs: 1.1b OS: RedHat 5.1, 5.2 Wai-Sun> Apparently EGCS craps out when a variable is defined as the Wai-Sun> arch name: i.e. alpha, i386, arm, m68k, mips, ppc, sparc, Wai-Sun> sparc64 Wai-Sun> I've confirmed it with i386 and alpha. To test yourself, try Wai-Sun> to compile the following simple program: Wai-Sun> ******************** try.c ********************* #include Wai-Sun> Wai-Sun> int main() { int alpha = 1; printf("alpha = %d\n", alpha); Wai-Sun> return 0; } Wai-Sun> ************************************************ Wai-Sun> You will get a "parse error before `1'". If you change alpha Wai-Sun> to nalpha or beta or anything other than alpha, then it'll Wai-Sun> work!!! This is very interesting. I'm running WindowMaker here and it compiled without problems. Kernel: 2.1.126 Egcs: 1.1b OS: Red Hat 5.0 +patches picu-sgh:~$ uname -a Linux picu-sgh.demon.co.uk 2.1.126 #2 Sat Oct 24 22:00:26 BST 1998 alpha unknown picu-sgh:~$ gcc --version egcs-2.91.57 picu-sgh:~$ cat junk.c #include int main() { int alpha = 1; printf("alpha = %d\n", alpha); return 0; } picu-sgh:~$ gcc -o junk -Wall -ansi -pedantic junk.c picu-sgh:~$ ./junk alpha = 1 Wai-Sun> Furthermore, if you s/alpha/i386/g in an Intel Linux box, Wai-Sun> guess what? Same problem!!! Wai-Sun> Perhaps the GCC/EGCS developers think that any programmer Wai-Sun> which defines a variable with the name as "i386" ought to be Wai-Sun> shot, but "alpha" is a pretty common variable. This is Wai-Sun> especially so in the graphics world where there is such a Wai-Sun> thing as an alpha-channel: in fact if you were to do a Wai-Sun> recursive grep in the WindowMaker sources, you'd be swamped! Wai-Sun> At first, I tried to rename the alpha variables to something Wai-Sun> else one by one, after the 10th file in the first Wai-Sun> subdirectory, I gave up. I tried to be smart and put this is Wai-Sun> the WindowMaker's system header file, "wraster.h" (this is Wai-Sun> WindowMaker 0.20.2): Wai-Sun> #define alpha wmalpha Wai-Sun> And voila! WM compiles OK! albeit tons and tons of warning Wai-Sun> messages, it runs too! But the graphics (icons and colors) and Wai-Sun> totally kaput! Apparently my "smart hack" changed the Wai-Sun> semantics of the system.... :-( Wai-Sun> This is what I see our options: 1. Make sure _ALL_ apps don't Wai-Sun> use arch names as variables (if cross-platform is important) Wai-Sun> 2. Ask politely GCC/EGCS developers to kindly remove this Wai-Sun> constraint from the compilers. Wai-Sun> I haven't sent any emails to neither GCC/EGCS nor WindowMaker Wai-Sun> developers. Want to see what other people think... Wai-Sun> BTW, libpng also suffers from this "alpha" variable Wai-Sun> syndrome.... Wai-Sun> -- Wai-Sun Wai-Sun> -- To unsubscribe: send e-mail to axp-list-request@redhat.com Wai-Sun> with 'unsubscribe' as the subject. Do not send it to Wai-Sun> axp-list@redhat.com