Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!nuchat!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: offsetof (was Arithmetic on NULL) Message-ID: <907@sugar.UUCP> Date: Sun, 25-Oct-87 12:46:48 EST Article-I.D.: sugar.907 Posted: Sun Oct 25 12:46:48 1987 Date-Received: Tue, 27-Oct-87 05:35:09 EST References: <1459@cullvax.UUCP> <48400001@tub.UUCP> <1151@haddock.ISC.COM> <2500@mmintl.UUCP> Organization: Sugar Land UNIX - Houston, TX Lines: 29 Summary: Unary & in constant expressions is needed. In article <2500@mmintl.UUCP>, franka@mmintl.UUCP (Frank Adams) writes: > In article <1076@jenny.cl.cam.ac.uk> am@cl.cam.ac.uk (Alan Mycroft) writes: > |I have a concern about this. ANSI (Oct 86) specifically disallows > |unary-& from appearing in constant expressions (no doubt > |except in sizeof() context).... Does this mean the following use of & in &STD_Gadget[n], which is being used in a context that requires a constant expression, is not ANSI standard? #define G(n) &STD_Gadget[n] ...other #defines removed for terseness... static struct Gadget STD_Gadget[GADGETS] = { /*NEXT, LFT, TP,WDTH, H, FLAG, ACT, TYP, REND, Z, TXT, Z, SPEC, ID, Z */ { G(1), IN1,TP1, WD1,HT, SF, SA, SG, Z, Z, Z, Z, SI(0), 0, 0 }, { G(2), IN1,TP2, WD1,HT, SF|SEL, SA, SG, Z, Z, Z, Z, SI(1), 1, 0 }, { G(3), IN1,TP3, WD1,HT, SF, SA, SG, Z, Z, Z, Z, SI(2), 2, 0 }, { NULL, IN5,TP5, WD5,HT5,PF, PA, PG, IMAG, Z, Z, Z, PROP, 3, 0 } }; Are you trying to tell me that building a linked list statically like this is not valid 'C' code? One of the great advantages 'C' has over *any* other conventional high level language[1] I know of is the ability to build complex data structures statically. -- [1] I hope you don't think Lisp, Forth, and APL are conventional languages. -- -- Peter da Silva `-_-' ...!hoptoad!academ!uhnix1!sugar!peter -- Disclaimer: These U aren't mere opinions... these are *values*.