Path: utzoo!mnetor!uunet!husc6!bbn!rochester!PT.CS.CMU.EDU!K.GP.CS.CMU.EDU!jgm From: jgm@K.GP.CS.CMU.EDU (John Myers) Newsgroups: comp.lang.c Subject: 'const' functions (`noalias' vs `register') Message-ID: <544@PT.CS.CMU.EDU> Date: 18 Dec 87 19:23:34 GMT References: <6829@brl-smoke.ARPA> <9753@mimsy.UUCP> <6830@brl-smoke.ARPA> <6845@brl-smoke.ARPA> <475@cresswell.quintus.UUCP> Sender: netnews@PT.CS.CMU.EDU Organization: System/Technology Development Corp. Lines: 13 In article <475@cresswell.quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes: >Anyway, why are the Committee only doing half a job? What's the >point of introducing NORMAL (the default being ABNORMAL) without >introducing REDUCIBLE (the default being IRREDUCIBLE)? Having >the C compiler recognise that sin(x) or strlen(s) only needs to >be evaluated more than once in some complicated expression would >be more useful to me than making promises about pointers that >the compiler isn't apparently expected to check, and the 'noalias' >attribute on the arguments is not enough to allow that optimisation. A reasonable syntax for such a thing would be to declare such functions as being 'const'. The overloading of the keyword would be analogous to (but not the same as) the overloading of the keyword 'static'.