public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* "mips" defined by gcc on little endian mips?
@ 2020-08-04  6:19 Ross Vandegrift
  2020-08-04  6:57 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Ross Vandegrift @ 2020-08-04  6:19 UTC (permalink / raw)
  To: gcc-help

(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?  

Thanks,
Ross

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: "mips" defined by gcc on little endian mips?
  2020-08-04  6:19 "mips" defined by gcc on little endian mips? Ross Vandegrift
@ 2020-08-04  6:57 ` Jonathan Wakely
  2020-08-04 15:41   ` Ross Vandegrift
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2020-08-04  6:57 UTC (permalink / raw)
  To: Ross Vandegrift; +Cc: gcc-help

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: "mips" defined by gcc on little endian mips?
  2020-08-04  6:57 ` Jonathan Wakely
@ 2020-08-04 15:41   ` Ross Vandegrift
  0 siblings, 0 replies; 3+ messages in thread
From: Ross Vandegrift @ 2020-08-04 15:41 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

On Tue, Aug 04, 2020 at 07:57:06AM +0100, Jonathan Wakely wrote:
> On Tue, 4 Aug 2020 at 07:20, Ross Vandegrift wrote:
> > 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

Perfect, thanks for the pointer!

Ross

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-04 15:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04  6:19 "mips" defined by gcc on little endian mips? Ross Vandegrift
2020-08-04  6:57 ` Jonathan Wakely
2020-08-04 15:41   ` Ross Vandegrift

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).