Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watmath.UUCP Path: utzoo!watmath!kpmartin From: kpmartin@watmath.UUCP (Kevin Martin) Newsgroups: net.lang.c Subject: Re: Dollars and Sense Message-ID: <10513@watmath.UUCP> Date: Mon, 31-Dec-84 09:30:07 EST Article-I.D.: watmath.10513 Posted: Mon Dec 31 09:30:07 1984 Date-Received: Tue, 1-Jan-85 00:41:17 EST References: <319@idis.UUCP> Reply-To: kpmartin@watmath.UUCP (Kevin Martin) Organization: U of Waterloo, Ontario Lines: 26 Summary: >There has been much discussion lately about using dollar signs >in identifier names or providing a mechanism in a C program >to associate a particular linker or assembler symbol with a particular >identifier. >I do not think that C source is the appropriate place to put >this information, but if one must, why not use the normal mechanism. > > asm("_sys_read = SYS$READ") ; Not every C compiler passes through an assembler. Not every C compiler supports the 'asm' "function". Even among C compilers which call assemblers, not all of them call 'as'. >On many UNIX brand systems, subroutines that call system calls >are written in assembly language and the object code is put in a library. >The subroutines provide both the appropriate subroutine linkage and return >sequence for C programs and the appropriate naming convention for C programs. >This seems to me to be a reasonable solution that could be used >in other applications or systems if it is necessary to deal >with strange symbols. > George Rosenberg > idis!george There is more in question than UNIX systems. Some of the strange names exist because of restrictions in the library implementation language (e.g. assembler), such as not allowing leading underscores in external names. Kevin Martin, UofW Software Development Group