Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!usc!bbn.com!mips2!granite!buck From: buck@granite.cr.bull.com (Kenneth J. Buck) Newsgroups: comp.lang.c Subject: Re: long identifiers Keywords: identifiers Message-ID: <1990Oct26.160212.14926@granite.cr.bull.com> Date: 26 Oct 90 16:02:12 GMT References: <15953@csli.Stanford.EDU> <487@taumet.com> <15959@csli.Stanford.EDU> <272477A0.6845@tct.uucp> <1925@tuvie> <1990Oct25.182246.27505@nntp-server.caltech.edu> <1990Oct26.115021.6330@watmath.waterloo.edu> Organization: Bull HN Information Systems Inc. Lines: 34 others have written: >>> [ .... ] [ from Henry Spencer's Ten Commandments... ] >>>9. Thy external identifiers shall be unique in the first six >>> characters, though this harsh discipline be irksome and the >>> years of its necessity stretch before thee seemingly without >>> end, lest thou tear thy hair out and go mad on that fateful >>> day when thou desirest to make thy program run on an old system. This need not be a problem, IF your COMPILER supports long symbol names (we're not talking about the linker here...). Your code can have lots of functions like: int long_function_name1 (stuff) ; int long_function_name2 (stuff) ; int long_function_name3 (stuff) ; . . . and if you have a requirement that the external names be short, then include a header file which redefines all the long names into short names, like: #define long_function_name1 aaaaa0 #define long_function_name2 aaaaa1 #define long_function_name3 aaaaa2 . . . This won't work if your compiler only supports short identifiers, but it will be fine for the case whether the only restriction is the length of the external names. That way, you can write code with long function names, and it can still be portable if necessary, by just remaping the names in the header file. Note: Some compilers use a name-mapping algorithm in order to achieve the external symbol name-length restrictions, instead of just truncating the name (something like, eliminate vowels starting from right to left, then consonants, etc., until no more than 6 chars remain, or whatever...).