On Wed, 22 Mar 2023, LIU Hao wrote:

Looking at the change, I see that you're trying to use __REGISTER_PREFIX__ to disambiguate between the two modes - but as far as I can see, __REGISTER_PREFIX__ expands to an empty string in both GCC and Clang, for both i686 and x86_64, when running in the default AT&T mode. So I don't really see how that mode detection is meant to work?

`__REGISTER_PREFIX__` expands to a token, not a string.

Sorry for the imprecise terminology - I meant that it expands to blank - no tokens at all, not an empty string. And it expands to blank for both AT&T and Intel mode.

For AT&T it expands to a modulo operator, and for Intel it expands to blank.

That's not my experience.

$ /usr/bin/x86_64-w64-mingw32-gcc -masm=att -E -dM - < /dev/null | grep REGISTER
#define __REGISTER_PREFIX__

$ cat att-intel.c
#if 0 __REGISTER_PREFIX__ + 1 == 0  // `0 % + 1 == 0` for at&t
#error att
#else
#error intel
#endif
$ /usr/bin/x86_64-w64-mingw32-gcc -c att-intel.c -masm=att
att-intel.c:4:2: error: #error intel
    4 | #error intel
      |  ^~~~~
$ /usr/bin/x86_64-w64-mingw32-gcc --version | head -1
x86_64-w64-mingw32-gcc (GCC) 10-posix 20220113


// Martin



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to