Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!ut-sally!husc6!rutgers!ames!lll-tis!ptsfa!hoptoad!academ!uhnix1!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: Does ANSI C have lengthof() ? Message-ID: <663@sugar.UUCP> Date: Sun, 6-Sep-87 13:45:26 EDT Article-I.D.: sugar.663 Posted: Sun Sep 6 13:45:26 1987 Date-Received: Wed, 9-Sep-87 05:45:44 EDT References: <9154@brl-adm.ARPA> <1265@mhres.mh.nl> <1059@haddock.ISC.COM> Organization: Sugar Land UNIX - Houston, TX Lines: 23 > In particular, couldn't one write a cpp that > recognizes "typedef" declarations? Such a preprocessor ought to be able to > handle any "sizeof(TYPE)" expression, and I'd be willing to do without > "sizeof(EXPR)". It would also have to recognise structures. typedef struct { something humungous with all sorts of arrays, pointers, enums, bit feilds, and unions } zot; #if sizeof(zot) > BUFSIZ #define BUFFERSIZE sizeof(zot) #else #define BUFFERSIZE BUFSIZ #endif I can't see how cpp could do that without learning most of 'C'. -- -- Peter da Silva `-_-' ...!seismo!soma!uhnix1!sugar!peter -- 'U` <-- Public domain wolf.