Xref: utzoo comp.lang.c:26748 comp.lang.misc:4390 Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!sunic!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.lang.c,comp.lang.misc Subject: Re: C strongly typed? Message-ID: <862@enea.se> Date: 10 Mar 90 00:06:59 GMT References: <259@eiffel.UUCP) <1990Mar1.172526.28683@utzoo.uucp) <849@enea.se) <1990Mar7.182230.5517@utzoo.uucp) Organization: Enea Data AB, Sweden Lines: 21 Henry Spencer (henry@utzoo.uucp) writes: )No, because the somewhat-misnamed "typedef" explicitly declares a synonym, )not a new type. However, if you write something like: ) ) char *p; ) int a; ) ... ) a = p; ) )any modern compiler will object. C's type system is not extensible unless )you count "struct", but the language is strongly typed -- mixing random )types is not allowed. Well, apparently I am allowed to mix apples and oranges. If I have two types of data that both happens to be represented by integers, but have no logical connection what so ever I cannot apparently express that in C. And consequently I cannot take help from the compiler to catch inadvertent mixups in for instance procedure calls. -- Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se