Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Why are typedef names in the same name space as variable names? Message-ID: <5435@brl-smoke.ARPA> Date: Sat, 6-Dec-86 11:51:10 EST Article-I.D.: brl-smok.5435 Posted: Sat Dec 6 11:51:10 1986 Date-Received: Sun, 7-Dec-86 22:11:57 EST References: <1092@spice.cs.cmu.edu> <307@cartan.Berkeley.EDU> <1063@ihdev.UUCP> <7374@utzoo.UUCP> <6430@alice.uUCp> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 22 In article <6430@alice.uUCp> bs@alice.UUCP writes: >file1: > typedef int I; > I i = 1; >file2: > typedef char* I; > I p = "asdf"; >Is it legal? Personally, I think not because the name I which is external by >default has two definitions (but the C++ compiler also accepts it). I see no more reason to consider the abbreviation `I' external than to do so for `COUNTER' in the following scenario: file1: #define COUNTER int COUNTER i = 1; file2: #define COUNTER long COUNTER l = 0; It appears to depend on whether one considers typedef to be a convenient shorthand or something more fundamental. If you adopt your view, then one needs to allow declarations such as: static typedef int I;