Prepending _ in C external names necessary?

Fishhook spw2562 at ritcv.UUCP
Thu Dec 5 01:26:56 AEST 1985


In article <200 at brl-tgr.ARPA> speck at cit-vlsi.arpa (Don Speck) writes:
>This purpose is served just as well by appending, rather than prepending,
>the underscore.  The former approach gives you a free extra character
>of significance in identifiers.
>
>	Don Speck	speck at cit-vlsi.arpa

Some assemblers (like ours) recognize a limited number of character(6(?)).
If identifier names in the source already exceed this length, appending
an underscore won't make any diff. example:

	  Function name:         With underscore:     Resulting symbol:
prepend:  dosomegoodstuff()      _dosomegoodstuff     _dosom
append:   dosomeotherstuff()     dosomeotherstuff_    dosome 

now suppose there's a symbol dosome defined by the assembler.  By prepending
you avoid a conflict.  with appending, you don't.

==============================================================================
        Steve Wall @ Rochester Institute of Technology
        USnail: 6675 Crosby Rd, Lockport, NY 14094, USA
        Usenet: ..!rochester!ritcv!spw2562 (Fishhook)   Unix 4.2 BSD
        BITNET: SPW2562 at RITVAXC (Snoopy)                VAX/VMS 4.2
        Voice:  Yell "Hey Steve!"

    Disclaimer:  What I just said may or may not have anything to do
                 with what I was actually thinking...



More information about the Comp.unix.wizards mailing list