Topic: change standard for return values and name mangling
Author: stan@mayo.edu (Andrew Staniszewski)
Date: 11 Oct 1993 15:07:13 GMT Raw View
The draft standard has a big whole in the name mangling/prototyping
the draft says a compiler does not see the difference between functions
based on thier return value ie:
if you define a function
boolean is_int() {...}
and then use and incorrect prototype
message is_int();
the compiler linker can not catch this bug. I t only shows up during run time,
when the stack gets blasted. I can understand, maybe, not wanting to deal with
is in terms of what overloaded function to call, but the return value SHOULD
get mangled into the function name, since calling the function incorrectly
screws the stack up
Author: maxtal@physics.su.OZ.AU (John Max Skaller)
Date: Thu, 14 Oct 1993 11:38:07 GMT Raw View
In article <29bsr1$iq4@fermat.mayo.edu> staniszewski@mayo.edu writes:
>
>The draft standard has a big whole in the name mangling/prototyping
>
>the draft says a compiler does not see the difference between functions
>based on thier return value ie:
>
>if you define a function
>
> boolean is_int() {...}
>and then use and incorrect prototype
>
> message is_int();
>the compiler linker can not catch this bug.
I think you misunderstand. MY compiler certainly catches
this bug. The C++ Working Papers dont say anything about name-mangling.
The *type* of the function *certainly* includes the
return type. Its just that the *signature* doesnt, meaning
the return type has no influence on overloading.
Declaring two functions with the same signature and
different return types is not allowed.
(BTW: however, the WP does not define 'signature' :-)
--
JOHN (MAX) SKALLER, INTERNET:maxtal@suphys.physics.su.oz.au
Maxtal Pty Ltd, CSERVE:10236.1703
6 MacKay St ASHFIELD, Mem: SA IT/9/22,SC22/WG21
NSW 2131, AUSTRALIA