[TUHS] About Unix header files

Dan Cross crossd at gmail.com
Thu Aug 23 02:04:15 AEST 2018


On Wed, Aug 22, 2018 at 9:45 AM Perry E. Metzger <perry at piermont.com> wrote:

> On Tue, 21 Aug 2018 16:37:43 -0500 Cornelius Keck <ckeck at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20180822/98fad13e/attachment.html>


More information about the TUHS mailing list