public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Liu Hao" <lh_mouse@126.com>
To: "Edward Diener" <eldlistmailingz@tropicsoft.com>, gcc-help@gcc.gnu.org
Subject: Re: Function attributes and x32, x64
Date: Sun, 02 Feb 2020 13:11:00 -0000	[thread overview]
Message-ID: <29e08084.e493.17006075515.Coremail.lh_mouse@126.com> (raw)
In-Reply-To: <r13m4f$jj6$1@ciao.gmane.io>

在 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

  reply	other threads:[~2020-02-02 13:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-01 11:07 Edward Diener
2020-02-02 13:11 ` Liu Hao [this message]
2020-02-03 18:37   ` Edward Diener
2020-02-05  3:31     ` Liu Hao
2020-02-05  9:52       ` Jonathan Wakely
2020-02-06  2:03         ` Liu Hao
2020-02-04 17:41 ` Jonathan Wakely
2020-02-04 23:24   ` Edward Diener
2020-02-05  9:50     ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29e08084.e493.17006075515.Coremail.lh_mouse@126.com \
    --to=lh_mouse@126.com \
    --cc=eldlistmailingz@tropicsoft.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).