On Fri, Aug 7, 2020 at 12:07 PM Noel Chiappa <jnc@mercury.lcs.mit.edu> wrote:

IIRC, you could use longer names than that (in C), but external references
only used the first 7 (in C - C symbols had a leading '_' tacked on; I used to
know why), 8 (in assembler).

Precisely to avoid collisions between external names in C and names in assembler (whose namespace was flat except for local labels) when they were linked into your program.

For similar reasons, F77 names had a trailing '_' tacked on.



John Cowan          http://vrici.lojban.org/~cowan        cowan@ccil.org
There is / One art / No more / No less
To do / All things / With art- / -Lessness          --Piet Hein