Prepending _ in C external names necessary?
Thomas H{meenaho
thomas at kuling.UUCP
Thu Dec 5 15:51:26 AEST 1985
In article <3040 at sun.uucp> guy at sun.uucp (Guy Harris) writes:
>> >We're considering changing our C compiler to *not* prepend an underscore
>> >at the beginning of all external names (functions, variables).
>>
>> I say don't do it!
>>
>This was (according to DMR) the reason this was done in the first place. I
>believe the 3Bs assemblers do not pre-define names like "r0" for the
>registers (I think you say something like "%0"), so they can get away with
>it.
I don't like this method of separating register names from identifiers.
In the SysV port for the 68K from Motorola they do just that. The net result
is that while you might save a few _:s, you loose much readability of the
assembler code. The silly %:s makes the code almost unreadable.
For C programs it doesn't really matter but when you're forced to do something
in assembler it's a pain.
I can't see the point why anyone would rather use the verrry frequent %:s
in favor of the rare _:s.
--
Thomas Hameenaho, Dept. of Computer Science, Uppsala University, Sweden
Phone: +46 18 138650
UUCP: thomas at kuling.UUCP (...!{seismo,mcvax}!enea!kuling!thomas)
More information about the Comp.unix.wizards
mailing list