On Wed, Aug 22, 2018 at 9:45 AM Perry E. Metzger <perry(a)piermont.com> wrote:
On Tue, 21 Aug 2018 16:37:43 -0500 Cornelius Keck
<ckeck(a)texoma.net>
wrote:
Early C-compilers didn't care much about
prototypes. The default
return type of a function would be an int. It was up to the code's
author to pass the right (amount, order, type). The linker didn't
care about signatures as long as the symbol resolved.
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.
One can embed type information in existing object file formats (e.g. ELF)
by placing it in dedicated sections. This is what Go does, for example. The
Go linker does some type analysis for reflection, though if symbols line up
it does not detect or prevent e.g. signature mismatches.
- Dan C.