Uses for non-unique names in structu - (nf)

jab at uokvax.UUCP jab at uokvax.UUCP
Sun Dec 25 13:41:23 AEST 1983


#R:mit-eddi:-100600:uokvax:17600001:000:877
uokvax!jab    Dec 22 13:00:00 1983


In response to the remark that "V7 and earlier complained if you had
non-unique member names (for different structures), regardless of type":

	No, the compiler accepted this IFF the duplicate names were the
	same type and offset into the structure.

I like the notion that for "struct gorp", all the members begin with "g_":

	struct gorp {
		int g_value;	/* value of this gorp */
		struct gorp *g_next;	/* pointer to next gorp in list */
		struct gorp *g_prior;	/* pointer to previous gorp in list */
	};
This makes reading the code a lot easier, really.

I believe that the compiler REALLY SHOULD honor the construct that allows
you to have non-unique member names, but since there's no "standard" anywhere,
who's to say? (And DON'T point me to the K&R book. The only thing that tells
me what is valid to the C compiler is the source, sad to say.)

	Jeff Bowles
	Lisle, IL



More information about the Comp.bugs.2bsd mailing list