How to detect user uses -masm=intel?

Florian Weimer fweimer@redhat.com
Thu Jul 29 08:38:56 GMT 2021


* unlvsur unlvsur via Gcc:

> What I mean is that what macro GCC sets when it compiles -masm=intel
>
>
> Int main()
> {
> #ifdef /*__INTEL_ASM????*/
>                 printf(“intel”);
> #else
>                 printf(“at&t”);
> #endif
> }

There doesn't seem to be such a macro:

$ diff -u <(gcc -dM -E -x c /dev/null) <(gcc -masm=intel -dM -E -x c /dev/null)
$ 

It doesn't look like it's possible to detect this as the GAS level
directly.  So you have to use the alternatives syntax that Andrew
suggested.

Thanks,
Florian



More information about the Gcc mailing list