Re: Function attributes and x32, x64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



在 2020/2/1 下午7:06, Edward Diener 写道:
> Given the code:
> 
> class cbase;
> int main()
>     {
>     typedef int __attribute__ ((__stdcall__)) (cbase::* atype)();
>     typedef int __attribute__ ((__cdecl__)) (cbase::* btype)();
>     typedef int __attribute__ ((__fastcall__)) (cbase::* ctype)();
>     typedef int __attribute__ ((__thiscall__)) (cbase::* dtype)();
>     return 0;
>     }
> 
> 
> If I compile this for x64 (-m64) in gcc-9.2 I receive no errors or
> warnings. Yet
> https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html tells me
> that all four are only for x86-32 targets. Is the documentation wrong,
> is this a bug in gcc-9.2, or have I missed something ?

Are you compiling for Windows targets? If you target x64 Windows then
it's likely that such attributes are accepted but ignored in line with
MS compilers.

-- 
Best regards,
LH_Mouse




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux