Expressions in initializers
Phil Lindsay
philbo at dhw68k.cts.com
Wed Mar 13 14:27:37 AEST 1991
In article <1032 at caslon.cs.arizona.edu> dave at cs.arizona.edu (Dave P. Schaumann) writes:
>In article <1991Mar4.144939.8311 at ux1.cso.uiuc.edu> mcdonald at 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 at dhw68k.cts.com Phone: Wrk7143852311 Hm7142891201
UUCP: {spsd,zardox,felix}!dhw68k!philbo
USMAIL: 152A S. Cross Creek Rd, Orange, Ca. 92669
More information about the Comp.lang.c
mailing list