Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!overload!dillon From: dillon@overload.Berkeley.CA.US (Matthew Dillon) Newsgroups: comp.sys.amiga.programmer Subject: Re: Manx vs. SAS/Lattice Message-ID: Date: 22 Apr 91 03:27:24 GMT References: <9104021420.AA10848@thunder.LakeheadU.Ca> <1991Apr19.193033.13587@visix.com> <1991Apr20.052047.18815@engin.umich.edu> Organization: Not an Organization Lines: 48 In article <1991Apr20.052047.18815@engin.umich.edu> milamber@caen.engin.umich.edu (Daryl Cantrell) writes: >In article <1991Apr19.193033.13587@visix.com> brett@visix.com writes: >>In article , stephen@cia.docs.uu.se (Stephen Cooper) writes: >>> Yet another bug in AztecC 5.0d: (YABIAC? :-) >>> Compiling this: >>> >>> void >>> DrawCurves (void) >>> { >>> SHORT xy[MAXPOINTS * 2]; >>> struct Border BezierBorder = >>> {0, 0, 1, 0, COMPLEMENT, MAXPOINTS, &xy, NULL}; >[...] Theoretically this is valid since BezierBorder is an auto, but the definition of ANSI C says that any auto-aggregate initialization (which is what you are doing) must contain only constants, as if it were a static initialization. So the &xy is illegal. -Matt > Whoa, hold up there... Address-of is a perfectly legal operation on an auto- >variable, it just isn't a valid initializer. Technically, the initializers It's a perfectly valid initializer but in the case of auto-aggregate initialization you can ONLY take the address of a static or global variable since that is, essentially, a constant. If 'xy' were declared static it would work. >for xy each time. BUT, it's not kosher C. I will say this: Manx should have >pointed out the specific error, not "internal error". no disagreement there. >+---------------------------------------+----------------------------+ >| // Daryl S. Cantrell | These opinions are | >| |\\\ milamber@caen.engin.umich.edu | shared by all of // | >| |// Evolution's over. We won. | Humanity. \X/ | >+---------------------------------------+----------------------------+ -Matt -- Matthew Dillon dillon@Overload.Berkeley.CA.US 891 Regal Rd. uunet.uu.net!overload!dillon Berkeley, Ca. 94708 USA