From: <no...@so...> - 2001-04-10 02:11:24
|
Bugs item #414798, was updated on 2001-04-08 21:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=414798&group_id=2435 Category: gcc Group: None Status: Open Priority: 5 Submitted By: TAMURA Kent (tkent) Assigned to: Nobody/Anonymous (nobody) Summary: __stdcall for inline method definition Initial Comment: Environment: gcc-2.95.2-3 Windows 2000 __stdcall is ignored if it is attached to inline definition of a method. For example: ------------------------------------------------ int bar(); class FooClass { public: virtual int __stdcall QueryInterfaceI(const void*, void**) { return bar(); } virtual int __stdcall QueryInterface(const void*, void**); }; int FooClass::QueryInterface(const void*, void**) { return bar(); } ------------------------------------------------- I compiled this source with "gcc.exe -O2 -S inline.cpp". Compiled code for FooClass::QueryInterfaceI() was: ------------------------------------- _QueryInterfaceI__8FooClassPCvPPv: pushl %ebp movl %esp,%ebp subl $8,%esp call _bar__Fv leave ret ------------------------------------- The "ret" at the last line must be "ret $12" because QueryInterfaceI() is __stdcall. ---------------------------------------------------------------------- >Comment By: TAMURA Kent (tkent) Date: 2001-04-09 19:11 Message: Logged In: YES user_id=163353 Oops, "gcc didn't print nothing" -> "gcc printed nothing" ---------------------------------------------------------------------- Comment By: TAMURA Kent (tkent) Date: 2001-04-09 19:09 Message: Logged In: YES user_id=163353 I built a FSF gcc-2.95.3 with Bob Wilson's patch (without mingw patches) and compiled the code above. But the gcc still generated a wrong code. I inserted printf() at patched blocks in the cp/decl.c. gcc didn't print nothing. Do I need other patches? -- TAMURA Kent ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2001-04-09 05:20 Message: Logged In: YES user_id=11494 Compiles correctly with gcc-2.95.3 with Bob Wilson's patch. Refer #414799 ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=102435&aid=414798&group_id=2435 |