On August 22, 2018 11:29:40 PM GMT+08:00, Paul Winalski
< paul.winalski(a)gmail.com> wrote:
On 8/22/18, Perry E. Metzger
<
perry(a)piermont.com> wrote:
To my knowledge, object file formats still don't have information
about type signatures, and linkers still don't care about types. This
is actually a problem. It would probably prevent a lot of errors if
those things changed.
For a linker to enforce (or warn about) type and call signature
matching, it would have to know the type and call semantics of each
particular language, and each particular compiler's switch options
that allow the programmer to bend the language rules. Not impossible,
but a difficult and cumbersome problem, particularly as language and
compiler implementation semantics vary over time.
C++ and other strongly-typed languages typically hack around the
problem using name decoration. Not elegant, but effective.
Has anyone experimented with building Unix using C++, to take
advantage of strong typing? My guess is no--it would be a Herculean
task likely to introduce more bugs than it would fix.
-Paul W.
Well, I agree with you that this may be achieved in the future.