Thinking about this once again:
I could imagine that one of the different FOO functions could
indeed be implemented in ASSEMBLER (without name mangling),
if the others stay C++ functions, and then the default mechanism
could work for this function, too.
But only one of them, otherwise there would be duplicate external names.
Only wild guess ...
Kind regard
Bernd
Am 27.05.2016 um 03:04 schrieb Bernd Oppolzer:
Isn't it a problem that with true C++ functions it is possible that
functions
can exist with the same name but different parameters, for example
void FOO (int x);
void FOO (double x);
void FOO (char *x);
and C++ chooses the right one depending on the parameter used on the
function call?
This is done by a mechanism known as "name mangling" (that is,
a designation of the parameter type is appended to the function name,
giving the true "technical" function name).
So, if this is true, how would you implement such a C++ function in
ASSEMBLER,
if you don't declare it as extern "C" or extern "ASSEMBLER"?
This being said: I don't think, the default mechanism will work in
this case,
but I may be wrong with this.
Kind regards
Bernd
Am 27.05.2016 um 00:05 schrieb Charles Mills:
I'm pretty sure I know the answer to this question but wondered if
someone
knew for sure.
If I declare a function void FOO(int x = 1); and call it with FOO()
then the
construction and passing of an integer parameter with a value of 1 is
entirely handled by the calling module, correct?
The reason I am asking ... suppose FOO is a function implemented in
assembler, not in C++. The declaration of the default parameter and the
invocation with the parameter omitted will still work, right?
Charles
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN