SKETCH OF HOW RESEARCH MIGHT CONTINUE AND RESULTS BE PRESENTED - PREVIEW ONLY

Functions

The decorated name for a function has the general form:

?name[@][scope@]@<attributes>[return]<arguments>Z

Attributes

The attributes field is compound. Two fields are mandatory. Between them may be as many as three optional fields. The number and meaning is determined from the first field’s classification of the function as one of:

Classification and Access Specifier

In addition to classifying the function, the first field also shows the access specifier (except for nonmembers).

Code Access Specifier Classification
$0 private vtordisp
$2 protected vtordisp
$4 public vtordisp
A private member
C private static member
E private virtual member
G private adjustor thunk
I protected member
K protected static member
M protected virtual member
O protected adjustor thunk
Q public member
S public static member
U public virtual member
W public adjustor thunk
Y   nonmember

Displacement

The vtordisp functions have two numerical attributes.

TO BE DONE

Offset

The adjustor thunk functions have one numerical field among their attributes.

TO BE DONE

This Qualifier

Functions that have an implied this argument, meaning all but static members and nonmembers, have a single-character field to show what qualifiers, if any, apply to this.

Calling Convention

TO BE DONE

A __cdecl
C __pascal
E __thiscall
G __stdcall
I __fastcall
L __syscall
M __clrcall

Of the seven calling conventions known to the compiler, only __cdecl, __fastcall and __stdcall are ordinarily accessible through keywords in the language.

The __thiscall convention is internal, being inferred for nonstatic member functions that do not have a calling convention specified in their declarations. However, __thiscall becomes a keyword under the action of the undocumented C1XX option -Binl, when it can then be useful for making explicit that omission of a keyword for some other convention is not just an oversight, and be arguably even more useful for calls through a pointer to nonstatic member functions of arbitrary objects.

Although __pascal and __syscall are retained as keywords, they are obsolete and use of them triggers a warning (C4226) to say so. As a calling convention however, __pascal is not quite so obsolete that support for it has yet been completely withdrawn. Compilation with the undocumented C1XX option -Gc causes __pascal to be inferred as the calling convention in default of any explicit specification or better inference. Incidentally, the compiler’s notion of this calling convention has it push arguments not from left to right as was long documented, but from right to left, as for __stdcall.

Return Type

Except if a function is a constructor or destructor, it has a return type shown in its decorated name. (Constructors and destructors are recognisable because their name field is ?0 or ?1 respectively.)

Argument Types

TO BE DONE