www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - __declspec(naked) - in DMC++?

↑ ↓ ← "Matthew Wilson" <matthew-hat -stlsoft-dot.-org> writes:
Does DMC support naked functions? If so, how?

Thanks in advance
Nov 13 2003
↑ ↓ "Walter" <walter digitalmars.com> writes:
"Matthew Wilson" <matthew-hat -stlsoft-dot.-org> wrote in message
news:bp1mbm$kn$1 digitaldaemon.com...
 Does DMC support naked functions? If so, how?

__declspec(naked) int foo() { __asm { ... } }
Nov 13 2003
"Matthew Wilson" <matthew-hat -stlsoft-dot.-org> writes:
Cool. :)

btw, do you know whether there's a consistent asm block keyword between the
Win32 compilers? _asm / __asm / asm ??

"Walter" <walter digitalmars.com> wrote in message
news:bp28fr$uof$2 digitaldaemon.com...
 "Matthew Wilson" <matthew-hat -stlsoft-dot.-org> wrote in message
 news:bp1mbm$kn$1 digitaldaemon.com...
 Does DMC support naked functions? If so, how?

__declspec(naked) int foo() { __asm { ... } }

Nov 14 2003
↑ ↓ "Walter" <walter digitalmars.com> writes:
"Matthew Wilson" <matthew-hat -stlsoft-dot.-org> wrote in message
news:bp3c1k$2oe8$1 digitaldaemon.com...
 btw, do you know whether there's a consistent asm block keyword between

 Win32 compilers? _asm / __asm / asm ??

There isn't, though DMC will take 'em all.
Nov 14 2003
↑ ↓ → "Matthew Wilson" <matthew-hat -stlsoft-dot.-org> writes:
I'll be able to let you know the accepted permutations by the end of today.
:(

"Walter" <walter digitalmars.com> wrote in message
news:bp3i48$u6$1 digitaldaemon.com...
 "Matthew Wilson" <matthew-hat -stlsoft-dot.-org> wrote in message
 news:bp3c1k$2oe8$1 digitaldaemon.com...
 btw, do you know whether there's a consistent asm block keyword between

 Win32 compilers? _asm / __asm / asm ??

There isn't, though DMC will take 'em all.

Nov 14 2003
"Matthew Wilson" <matthew-hat -stlsoft-dot.-org> writes:
Given that it supports naked, the unvoiced translation of fastcall to cdecl
is a manifest bug, surely? We need the compiler to issue an error when
naked+fastcall are used

"Walter" <walter digitalmars.com> wrote in message
news:bp28fr$uof$2 digitaldaemon.com...
 "Matthew Wilson" <matthew-hat -stlsoft-dot.-org> wrote in message
 news:bp1mbm$kn$1 digitaldaemon.com...
 Does DMC support naked functions? If so, how?

__declspec(naked) int foo() { __asm { ... } }

Nov 16 2003
↑ ↓ "Walter" <walter digitalmars.com> writes:
"Matthew Wilson" <matthew-hat -stlsoft-dot.-org> wrote in message
news:bp8n99$1qcs$1 digitaldaemon.com...
 Given that it supports naked, the unvoiced translation of fastcall to

 is a manifest bug, surely? We need the compiler to issue an error when
 naked+fastcall are used

Except that fastcall is not supported at all, so I am not understanding what the issue is.
Nov 16 2003
↑ ↓ "Matthew Wilson" <matthew-hat -stlsoft-dot.-org> writes:
But it is supported, in a way.

void __fastcall f()
{}

compiles without a murmur, and silently translates the __fastcall into a
cdecl. (Use your marvellous obj2asm if you don't believe me)

In combination with __declspec(naked), this is a seriously evil bug.

To my mind the whole thing should be an error. The minimum needed is for
__fastcall to produce a warning without __declspec(naked), and an error with
it.

"Walter" <walter digitalmars.com> wrote in message
news:bp967s$2h3s$1 digitaldaemon.com...
 "Matthew Wilson" <matthew-hat -stlsoft-dot.-org> wrote in message
 news:bp8n99$1qcs$1 digitaldaemon.com...
 Given that it supports naked, the unvoiced translation of fastcall to

 is a manifest bug, surely? We need the compiler to issue an error when
 naked+fastcall are used

Except that fastcall is not supported at all, so I am not understanding

 the issue is.

Nov 16 2003
↑ ↓ → "Walter" <walter digitalmars.com> writes:
"Matthew Wilson" <matthew-hat -stlsoft-dot.-org> wrote in message
news:bp9aj8$2n3v$1 digitaldaemon.com...
 But it is supported, in a way.

 void __fastcall f()
 {}

 compiles without a murmur, and silently translates the __fastcall into a
 cdecl. (Use your marvellous obj2asm if you don't believe me)

 In combination with __declspec(naked), this is a seriously evil bug.

 To my mind the whole thing should be an error. The minimum needed is for
 __fastcall to produce a warning without __declspec(naked), and an error

 it.

Ok, I understand what you mean now.
Nov 16 2003