Expressions in initializers

Richard Caley rjc at uk.ac.ed.cstr
Sun Mar 10 04:29:07 AEST 1991


In article <SUHONEN.91Mar7104347 at kunto.jyu.fi>, Timo Suhonen (ts) writes:

rjc at uk.ac.ed.cstr (Richard Caley) writes:

rjc> Is it possible to know before the program is linked (run if you have
rjc> run time linking!). What stops me from defining my own sqrt?

ts> Doesn't ANSI standard let the compiler know the standard functions???
ts> If so, then sqrt(double) can be evaluated at compile time. And I
ts> think that is just what every compiler SHOUD do!

Thank's to everyone who let me know this. I hadn't realised it, not
having the stamina to read the standard.

On the other hand, not all the world is ANSI, and even if it were this
does not imply that you can (easily) do run time evaluation.

Gratuitous moan: While I understand the reasons for this restriction,
	it _is_ ugly as sin and does mean you need to have a linker
	which understands C.

--
rjc at cstr.ed.ac.uk



More information about the Comp.lang.c mailing list