public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/4507: __attribute__((stdcall)) is ignored on methods defined inside the class declaration
@ 2001-10-08 12:26 malte.starostik
  0 siblings, 0 replies; only message in thread
From: malte.starostik @ 2001-10-08 12:26 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4507
>Category:       c++
>Synopsis:       __attribute__((stdcall)) is ignored on methods defined inside the class declaration
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 08 12:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Malte Starostik
>Release:        gcc version 2.95.3 19991030 (prerelease) and gcc version 3.0.2 20010911 (prerelease) at least
>Organization:
>Environment:
GNU/Linux on i386
>Description:
The __attribute__((stdcall)) is ignored on methods defined inside the class declaration. This applies to static as well as non-static methods.
The code generated for A::foo() and A::bar() in the attached test case clearly shows this:
while A::foo() correclty returns via "ret $4", A::bar() uses a plain "ret".
>How-To-Repeat:
Compile stdcall.cpp with g++ -S -o stdcall.S stdcall.cpp and compare the code for both methods.
>Fix:
Workaround: always define "stdcall"-methods outside the class declaration.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="stdcall.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="stdcall.cpp"

CmNsYXNzIEEKewpwdWJsaWM6CglzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChzdGRjYWxsKSkg
Zm9vKGNoYXIgKik7CglzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChzdGRjYWxsKSkgYmFyKGNo
YXIgKikgeyByZXR1cm47IH0KfTsKCnZvaWQgQTo6Zm9vKGNoYXIgKikKewoJcmV0dXJuOwp9Cgpp
bnQgbWFpbigpCnsKCUE6OmZvbygwKTsKCUE6OmJhcigwKTsKfQoK


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-10-08 12:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-08 12:26 c++/4507: __attribute__((stdcall)) is ignored on methods defined inside the class declaration malte.starostik

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).