"mips" defined by gcc on little endian mips?

Jonathan Wakely jwakely.gcc@gmail.com
Tue Aug 4 06:57:06 GMT 2020


On Tue, 4 Aug 2020 at 07:20, Ross Vandegrift wrote:
>
> (please CC me on replies, I'm not subscribed)
>
> Surprisingly (to me), this works on little endian mips:
>   #include <stdio.h>
>
>   int main(int argc, char *argv[])
>   {
>     printf("%d\n", mips);
>   }
>
> Disabling GNU extensions with -std restores expected behavior.  Tested with gcc
> 10.2 & 8.3 on debian sid & buster.  I couldn't find an obvious explanation in
> the keyword index.  Is this behavior expected?

Yes, the example of "mips" is even covered explicitly in the documentation:
https://gcc.gnu.org/onlinedocs/cpp/System-specific-Predefined-Macros.html


More information about the Gcc-help mailing list