www.digitalmars.com         C & C++   DMDScript  

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

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

Thanks in advance
Nov 13 2003
parent reply "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
next sibling parent reply "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
parent reply "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
the
 Win32 compilers? _asm / __asm / asm ??
There isn't, though DMC will take 'em all.
Nov 14 2003
parent "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
the
 Win32 compilers? _asm / __asm / asm ??
There isn't, though DMC will take 'em all.
Nov 14 2003
prev sibling parent reply "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
parent reply "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
cdecl
 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
parent reply "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
cdecl
 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
parent "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
with
 it.
Ok, I understand what you mean now.
Nov 16 2003