External names in other languages
Mark Purtill
Purtill at MIT-MULTICS.ARPA
Wed Jan 16 09:51:34 AEST 1985
Paul Schauble suggests:
> I would like to make a proposal for the new standard. As a basic part of
> the standard, allow the construction
>
> identifier ENTRY "external_name"
>
> in every context where identifier is visible beyond the current
> compilation unit. For example,
>
> extern int current_date entry "SYS$DATE";
to which shades at mit-oz replies
> it is a sound idea admittedly but it seems to me that all you
> are doing is the standard(?) practice of
>
> #define this_is_a_very_long_name xyzzy
> int this_is_a_very_long_name;
>
> when the compiler generates the internal global symbols table then for
> the linker all references would be to variable xyzzy.
This only works where the external variable (eg xyxxy) is legal in C.
The point is that for instance SYS$DATE /isn't/ legal in (standard) C,
due to the '$'. Probably one can find OS's with arbitrarily unpleasent
characters in system variables (e.g., DG's AOS/VS prepends '?' to all
system calls, which could be confused with the ?: operator.)
Mark
More information about the Comp.lang.c
mailing list