C optimizer

Wayne Mesard mesard at bbn.com
Thu Feb 16 01:04:55 AEST 1989


In article <9648 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>There is no standard mechanism for an application to declare its own
>functions as "pure"; however, if the compiler has access to all files
>it may be able to make such a determination itself.

Anyone want to challenge (by way of counter-example) the hypothesis that

  A function which is entirely composed of known "pure" operations*
  is, itself, pure.

* Where pure operations is defined as functions that produce no side
effects and return deterministic values, and most operators (excluding
assignment to dereferenced pointers and globals).  Hint: Sleep(3) would,
I believe, be labelled "pure" under this definition, so something's
still missing.

-- 
unsigned *Wayne_Mesard();
MESARD at BBN.COM           
BBN, Cambridge, MA       



More information about the Comp.lang.c mailing list