Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!hsi!stpstn!lerman From: lerman@stpstn.UUCP (Ken Lerman) Newsgroups: comp.lang.c Subject: Re: Expressions in initializers Message-ID: <6514@stpstn.UUCP> Date: 5 Mar 91 17:56:13 GMT References: <17270@crdgw1.crd.ge.com> <760@ajpo.sei.cmu.edu> <1991Mar4.144939.8311@ux1.cso.uiuc.edu> Reply-To: lerman@stpstn.UUCP (Ken Lerman) Organization: The Stepstone Corporation, Sandy Hook, CT 06482 Lines: 17 In article <1991Mar4.144939.8311@ux1.cso.uiuc.edu> mcdonald@aries.scs.uiuc.edu (Doug McDonald) writes: > >sqrt(2.0) is an expression. It CAN be evaluated at compile time. Perhaps >some people don't want to write compilers that do that (i.e. they are too >lazy), but it most certainly CAN be evaluated. > >Perhaps a different explanation is appropriate? > >Doug McDonald It may be true that under ANSI C sqrt(2.0) CAN be evaluated at compile time. But prior to ANSI, the value of sqrt(2.0) could not be because the programmer was free to call any function he wanted "sqrt". Prior to ANSI, the semantics of sqrt might not be determined until link time. Ken