Reserved names in ANSI C

Norman Diamond diamond at diamond.csl.sony.junet
Thu Jul 6 15:04:32 AEST 1989


In article <461 at algor2.UUCP> jeffrey at algor2.UUCP (Jeffrey Kegler) writes:

>The only real solution to this problem is something like the renaming
>facility that was allowed in ADA.

(Ada and a few other languages.)

>That is, suppose you are using one
>person's window manager library, and the patented WhatchaMacallit
>database.  Both use names all carefully prefixed with WM_ to prevent
>conflicts.  The only way to prevent conflicts like this is to license
>library writers, which solution is far worse than than (admittedly
>nasty) problem.  And here both library writers have tried to be
>careful, at the expense of readability.  They left themselves exactly
>three characters in which their external names must be distinct.
>(They could try numbering them, WM_000, WM_001, etc.) :-)

No :-) is needed.  Cobol programmers have known this solution for a
long time, and the length of distinct characters wasn't even the reason.
Names should indeed be numbered:

WM_000_long_descriptive_name
WM_001_another_long_descriptive_name
WM_002_yaldn  /* i guess this one wasn't so long :-) */

Yes, renaming is still necessary to deal with several libraries that
unfortunately chose the same prefix.  Yes the only other solution,
licensing, would be worse than the problem.  But no one would obey
the licensing requirement anyway -- because the licence might prohibit
them from defining __STDC__ as 0.

--
Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.jp at relay.cs.net)
 The above opinions are claimed by your machine's init process (pid 1), after
 being disowned and orphaned.  However, if you see this at Waterloo, Stanford,
 or Anterior, then their administrators must have approved of these opinions.



More information about the Comp.std.c mailing list