Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!sri-spam!mordor!lll-tis!ptsfa!ihnp4!cuae2!ltuxa!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: comp.lang.c Subject: Re: Incomplete structure declarations as opaque data types Message-ID: <1894@ttrdc.UUCP> Date: Thu, 10-Sep-87 01:27:04 EDT Article-I.D.: ttrdc.1894 Posted: Thu Sep 10 01:27:04 1987 Date-Received: Sat, 12-Sep-87 09:47:02 EDT References: <1396@bloom-beacon.MIT.EDU> Organization: AT&T, Skokie, IL Lines: 34 In article <1396@bloom-beacon.MIT.EDU>, newman@athena.mit.edu (Ron Newman) writes: > The following program is legal, lint-free C, and demonstrates how one can > implement an abstract ("opaque") data type: > > typedef struct _ThingRec ThingRec, *Thing; > extern Thing CreateThing(); > > main() { > Thing thing = CreateThing (4, 7); > OperateOnThing(thing); > DestroyThing (thing); > } $ lint Thing.c Thing.c ============== (8) warning: main() returns random value to invocation environment (9) warning: struct/union _ThingRec never defined (9) warning: struct/union ThingRec never defined ============== name used but not defined CreateThing Thing.c(5) OperateOnThing Thing.c(6) DestroyThing Thing.c(7) $ uname -a ttrdc ttrdc 2.0v3 0915 3B-20S -- |------------Dan Levy------------| Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa, | an Engihacker @ | vax135}!ttrdc!ttrda!levy | AT&T Computer Systems Division | Disclaimer: i am not a Yvel Nad |--------Skokie, Illinois--------|