[comp.std.c] 31 character identifier length

nevin1@ihlpb.ATT.COM (Liber) (12/21/88)

In article <12643@bellcore.bellcore.com> sjs@sjs@ctt.bellcore.com (Stan Switzer) writes:

>A compiler that accepts identifiers longer than 31 characters or even
>arbitrarily long identifiers is still a conforming compiler.  It is
>only those which do not accept at least 31 characters uniqueness
>(within a compilation unit) which do not conform.

Although you are correct here (as per 10/88 draft), is this really what
is intended?  Should it really be possible for

	ThirtyTwoCharacterFunctionName00();

	ThirtyTwoCharacterFunctionName01();

to reference different functions on some *conforming* implementations and
to reference the same function on other *conforming* implementions,
without either one having to give out even a warning (Note:  you may
say that the 'function multiply defined' error will come up when
linking takes place; however, if you are using libraries this won't
necessarily happen)?
-- 
NEVIN ":-)" LIBER  AT&T Bell Laboratories  nevin1@ihlpb.ATT.COM  (312) 979-4751

jfh@rpp386.Dallas.TX.US (The Beach Bum) (12/22/88)

In article <9234@ihlpb.ATT.COM> nevin1@ihlpb.UUCP (55528-Liber,N.J.) writes:
>Although you are correct here (as per 10/88 draft), is this really what
>is intended?  Should it really be possible for
>
>	ThirtyTwoCharacterFunctionName00();
>
>	ThirtyTwoCharacterFunctionName01();
>
>to reference different functions on some *conforming* implementations and
>to reference the same function on other *conforming* implementions,
>without either one having to give out even a warning ...

My compiler d' jour provides warning messages only if two objects exist
inside the same compilation unit and don't have names unique to 31
characters.  One would hope the compiler would a) use the complete
identifier, or 2) complain about a multiply defined symbol, but not
accept a second definition and then ignore it ...

Obviously, if the names are not unique between compilation units, it
ceases to be a compiler question.  I seem to recall someone saying the
draft made no promises about external identifiers over 7 [ 8? ]
characters.  You would have a problem in that situation ...
-- 
John F. Haugh II                        +-Quote of the Week:-------------------
VoiceNet: (214) 250-3311   Data: -6272  |"Unix doesn't have bugs,
InterNet: jfh@rpp386.Dallas.TX.US       | Unix is a bug"
UucpNet : <backbone>!killer!rpp386!jfh  +--              -- author forgotten --

nevin1@ihlpb.ATT.COM (Liber) (12/23/88)

In article <10237@rpp386.Dallas.TX.US> jfh@rpp386.Dallas.TX.US (The Beach Bum) writes:

>My compiler d' jour provides warning messages only if two objects exist
>inside the same compilation unit and don't have names unique to 31
>characters.  One would hope the compiler would a) use the complete
>identifier, or 2) complain about a multiply defined symbol, but not
>accept a second definition and then ignore it ...

let me give a clearer example:

int	ThirtyTwoCharacterVariableIdentG;
...
void	foo(void)
{
	int	ThirtyTwoCharacterVariableIdentL;

	...
	ThirtyTwoCharacterVariableIdentG = 1;
	...
}

How a compiler handles this is, according to 3.1.2, 10/88 draft,
implementation limits section, paragraph 2, p.21:

"If two identifiers differ in a non-significant character, the behavior
is undefined."

In other words, using identifiers > 31 characters can be (although not
necessarily are) dangerous!
-- 
NEVIN ":-)" LIBER  AT&T Bell Laboratories  nevin1@ihlpb.ATT.COM  (312) 979-4751

gwyn@smoke.BRL.MIL (Doug Gwyn ) (12/27/88)

In article <9234@ihlpb.ATT.COM> nevin1@ihlpb.UUCP (55528-Liber,N.J.) writes:
>Although you are correct here (as per 10/88 draft), is this really what
>is intended?

Definitely Yes!

rsp@pbhyf.PacBell.COM (Steve Price) (12/31/88)

In article <9265@ihlpb.ATT.COM> nevin1@ihlpb.UUCP (55528-Liber,N.J.) writes:
>
>In other words, using identifiers > 31 characters can be (although not
>necessarily are) dangerous!

Sad coding experiences have taught me that if something CAN be dangerous, it IS.
My high school driving teacher's rule sums it up: "If something along the
road can be run into, it will be."

Steve Price
pacbell!pbhyf!rsp
(415)823-1951

meissner@xyzzy.UUCP (Michael Meissner) (01/02/89)

In article <9234@ihlpb.ATT.COM> nevin1@ihlpb.UUCP (55528-Liber,N.J.) writes:
| Although you are correct here (as per 10/88 draft), is this really what
| is intended?  Should it really be possible for
| 
| 	ThirtyTwoCharacterFunctionName00();
| 
| 	ThirtyTwoCharacterFunctionName01();
| 
| to reference different functions on some *conforming* implementations and
| to reference the same function on other *conforming* implementions,
| without either one having to give out even a warning (Note:  you may
| say that the 'function multiply defined' error will come up when
| linking takes place; however, if you are using libraries this won't
| necessarily happen)?

Given that all the standard requires is that EXTERNAL names match in the
first SIX (6) characters, with no case distinction, it is certainly within
the realm of possible implementations to only recognize external names to
31 characters.  And yes, much time was spent in debating this (and flaming
on the net as well).  As with many painful choices the committee made, this
was not done lightly.  It was done because of various old musty linker or
assembler technology that cannot be changed.
-- 
Michael Meissner, Data General.

Uucp:	...!mcnc!rti!xyzzy!meissner
Arpa:	meissner@dg-rtp.DG.COM   (or) meissner%dg-rtp.DG.COM@relay.cs.net