Re: Union nested in structure.
From: Dave Thompson (david.thompson1_at_worldnet.att.net)
Date: 02/14/05
- Next message: Dave Thompson: "Re: passing array to isdigit()"
- Previous message: Dave Thompson: "Re: Very very very basic question"
- In reply to: Michael Wojcik: "Re: Union nested in structure."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 14 Feb 2005 09:46:38 GMT
On 9 Feb 2005 20:36:47 GMT, mwojcik@newsguy.com (Michael Wojcik)
wrote:
<snip>
> Because that's how the committee thought it should work, and not
> specifying the tag scope rules would have been a Bad Thing.
>
> (And, IIRC, the single global-scope tag namespace existed in pre-
> standard C as well, so they're preserving existing practice. What
> did change was the separation of members into their own scoped
> namespace. Or was it that members had their own namespace, but it
> had global scope? Or was there only a single namespace for tags,
> members, and ordinary identifiers? I no longer have a pre-standard
> K&R to consult.)
>
*Very* early C had one namespace for (names of) members of all structs
-- or at least all structs at (what we now call) file scope, I don't
recall if there were struct definitions within a function/block at all
-- and you could apply member names "of" (from) any struct as members
of any (other) struct, with often wrong results. This is why the API
structs that survive from early Unix like tm (tm_year, tm_mon etc.)
and <not standard C> stat (st_mode, st_mtime etc.) have the struct
encoded in the member names to ensure they don't conflict. I'm pretty
sure that even then members were isolated from ordinary identifiers
and tags; and that members became per-struct even before K&R1 much
less the standard, though I also no longer have a 1ed to check.
- David.Thompson1 at worldnet.att.net
- Next message: Dave Thompson: "Re: passing array to isdigit()"
- Previous message: Dave Thompson: "Re: Very very very basic question"
- In reply to: Michael Wojcik: "Re: Union nested in structure."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|