Subject: Re: xdr_float.c?
To: None <agrier@poofy.goof.com, simonb@telstra.com.au>
From: Noriyuki Soda <soda@sra.co.jp>
List: tech-toolchain
Date: 03/30/1999 20:47:40
> The problem is that lint is setting __${MACHINE_ARCH}__, which is mipsel
> now. I guess we have two options:
>
> a) Change all occurances of "if defined(__mips__)" to
> "if defined(__mipseb__) || defined(__mipsel_)". In the tree at the
> moment, there are 4 files in gcc, 5 in sys and 15 others that
> check for __mips__
>
> b) Special case mips in xlint/xlint.c in the following chunk of code:
>
> #ifdef MACHINE_ARCH
> if (strcmp(un.machine, MACHINE_ARCH) != 0) {
> appdef(&cppflags, MACHINE_ARCH);
> appstrg(&lcppflgs, concat2("-D", MACHINE_ARCH));
> }
> #endif
>
> I'm tempted to do (a)...
Mmm, I think (b) is better than (a).
In many case, "if defined(__mips__)" seems to be better than
"if defined(__mipseb__) || defined(__mipsel_)". If the code doesn't
concern with the endian, why don't just use "__mips__" ?
The "__mips__" symbol is defined on all MIPS platforms, not only NetBSD,
thus we cannot remove -D__mips__ from gcc configuration, anyway.
The real problem seems to be that there is no symbol which defines CPU
architecure ("mips").
The "MACHINE" is needed because we have to distinct the platform.
The "MACHINE_ARCH" is needed because we have to distinct the binary
compatibility.
But there is no symbol which can be used to distinct the source level
compatibility. If such symbol exist, we can remove all hacks like
${MACHINE_ARCH:C/mipse[bl]/mips/}.
There will be same problem on SH3. (SH3 runs both little and big endian).
--
soda