Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: ANSI C suggestions Message-ID: <4460@utzoo.UUCP> Date: Mon, 15-Oct-84 12:54:28 EDT Article-I.D.: utzoo.4460 Posted: Mon Oct 15 12:54:28 1984 Date-Received: Mon, 15-Oct-84 12:54:28 EDT References: <228@boulder.UUCP> Organization: U of Toronto Zoology Lines: 23 > (1) Get rid of that requirement that all floating point arithmetic > be done in floating point. ... I assume you mean "be done in double precision"! The ANSI committee is ahead of you on this one. Expressions involving only "float" quantities may be done in "float" precision if the compiler so chooses. Note that this is not compulsory; it's up to the compiler implementors. Note also that constants are still "double" unless explicitly cast to "float", which is a nuisance (the alternative was nightmarish problems in deciding the type of a floating-point constant). Not ideal, but workable. > (2) The DEC C compiler allows a "readonly" designation on global > variables. This is handy to insure that one does not overwrite > static lookup tables and such. ... Again the committee is ahead of you. There is a "const" modifier in the draft, taken from recent Bell-internal versions of C. It does more than you suggest -- in my opinion, more than is really necessary -- but it can be used to get this effect in particular. It is not just a convenience; people who are putting tables into ROM for micros need it badly. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry