Expressions in initializers

Dan Horsfall ddh at hare.cdc.com
Fri Mar 8 04:21:21 AEST 1991


In article <1043 at caslon.cs.arizona.edu>
  dave at cs.arizona.edu (Dave P. Schaumann) writes:
> 
>         ... the logical conclusion of "constant" evaluation at compile-time
> will make C compiler into a C interpreter as well.  I have been reminded in
> the past that C is supposed to be a small language (when wishing for a
> largest-of operator on enums).  Think how much more work the compiler must
> do to evaluate constant-parameter functions at compile time, even if you
> limited this to standard library functions.
> 
> 		Dave Schaumann		dave at cs.arizona.edu

OK, heres my $0.02.  How many of you out there really want "constant 
expressions" evaluated over and over again at run-time??  How many
times will your code be run, vs. how many times will be it be 
compiled? 

I know I'll attract flames galore with this attitude, but I expect, even
assume decent compilers to eliminate this stuff without being told (i.e.,
without the higher optimization levels).  In this shop, the goal is
NOT performance for the developer -- it's meeting the needs of the
fur-bearing, revenue-producing, end user -- the Customer!

I admit, of course, that not every one needs to write code as if his
livlihood depended on it.

-- 
   Horse
                                       +    Control Data Corporation      
   Dan Horsfall     +1-612-482-4622    +    4201 Lexington Ave North      
   Internet   ddh at dash.udev.cdc.com    +    Arden Hills MN 55126 USA      



More information about the Comp.lang.c mailing list