Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!mjs From: mjs@hpfcso.HP.COM (Marc Sabatella) Newsgroups: comp.lang.misc Subject: Re: C strongly typed? Message-ID: <8960013@hpfcso.HP.COM> Date: 8 Mar 90 16:49:05 GMT References: <849@enea.se> Organization: Hewlett-Packard, Fort Collins, CO, USA Lines: 25 >C strongly typed? If I write something like: (I don't speak C >so the syntax is probably bogus.) > > typedef apple int; > typedef orange int; > apple a; > orange b; > ... > a = b; > >Will a "modern" compiler object? No. C uses (mostly) "structural equivalence" for determining when two types are compatible. You seem to be saying that "strong typing" implies "name equivalence", which is not the way we learned it. There are three sets of completely orthogonal distinctions here strong vs weak typing (does everything have a type at compile time?) name vs structural equivalence (when are two types equivalent?) strict vs non-strict type checking (does the compiler allow type mismatches?) C is strong, non-strict, and structural (although ANSI is quite a bit stricter than K&R, it still has automatic type promotions). Marc