Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!zardoz.cpd.com!dhw68k!philbo From: philbo@dhw68k.cts.com (Phil Lindsay) Newsgroups: comp.lang.c Subject: Re: Expressions in initializers Message-ID: <1991Mar13.042737.26728@dhw68k.cts.com> Date: 13 Mar 91 04:27:37 GMT References: <760@ajpo.sei.cmu.edu> <1991Mar4.144939.8311@ux1.cso.uiuc.edu> <1032@caslon.cs.arizona.edu> Organization: Wolfskill & Dowling residence; Anaheim, CA (USA) Lines: 24 In article <1032@caslon.cs.arizona.edu> dave@cs.arizona.edu (Dave P. Schaumann) writes: >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? > >You want to link the whole floating point library to the C compiler? > >First thing you need to realize is that there is no special, pre-defined >function sqrt() in C. (Suprise!!!) The function sqrt lives in a link >libarary. As far as the C compiler knows, it's just another user-defined >function. So it can't really be evaluated at compile time. > The MSC compiler "knows" strcpy(), memcpy(), etc... The compiler produces inline versions of these functions. Compile guru's will do almost anything for speed. -- Phil Lindsay - "Patents threaten future technology" Internet: philbo@dhw68k.cts.com Phone: Wrk7143852311 Hm7142891201 UUCP: {spsd,zardox,felix}!dhw68k!philbo USMAIL: 152A S. Cross Creek Rd, Orange, Ca. 92669