Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.PCS 1/10/84; site ahuta.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!genrad!decvax!bellcore!sabre!zeta!epsilon!gamma!ulysses!mhuxr!mhuxt!houxm!ahuta!rkl From: rkl@ahuta.UUCP Newsgroups: net.lang.c Subject: Re: AT&T 7300 C compiler/ variable name lengths (general) Message-ID: <585@ahuta.UUCP> Date: Tue, 9-Apr-85 13:26:43 EST Article-I.D.: ahuta.585 Posted: Tue Apr 9 13:26:43 1985 Date-Received: Sat, 13-Apr-85 14:58:29 EST References: <9726@brl-tgr.ARPA> Organization: AT&T Information Systems Labs, Holmdel NJ Lines: 25 REFERENCES: <9726@brl-tgr.ARPA> There usually is a difference between what the C compiler accepts as names and what the ASSEMBLER accepts as names. In general I have found that using only 7 character names is safest, ie. guarantees uniqness. Yes, C is supposed to accept variable names with more that 8 chars, but the assembler may not. For example, try two defining two variables names that match for the first 7 chars but differ in the 8th, and compiling it. I have found that the C compiler has no trouble with this but the assembler prepends an underscore and truncates to 8 chars (so now the variable names match), which of course causes 'compile' errors. I should mention that the above pertains to C compilers in general. Personally, I would stick to a maximum of 7 chars for a variable name. I find long names very annoying and subject to typos. Yes this means more cryptic names, but the solution is to put COMMENTS in your C code (mini-flame: most C programs have extremely little in the way of comments). In addition, shorter names will improve portability. R. Kevin Laux Software Vendor Tech Support ATTIS, Lincroft ahuta!rkl