Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rlgvax.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.lang.c Subject: Re: ANSI C suggestions Message-ID: <195@rlgvax.UUCP> Date: Sun, 14-Oct-84 19:05:06 EDT Article-I.D.: rlgvax.195 Posted: Sun Oct 14 19:05:06 1984 Date-Received: Tue, 16-Oct-84 03:41:43 EDT References: <228@boulder.UUCP> Organization: CCI Office Systems Group, Reston, VA Lines: 37 > As long as we are discussing improvements to the language, I would > like to suggest a couple: > > (1) Get rid of that requirement that all floating point arithmetic > be done in floating point. ... I don't care if I have to > set a compiler flag or whatever, as long as I can use single > precision arithmetic. I presume you meant "done in double precision", not "done in floating point"; floating point is not required to be in double precision by the ANSI C draft standard. (It's not even so required by the PDP-11 hardware, but that's another story.) > (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. VAX type machines can easily > implement readonly variables. I suggest that readonly should > be part of the language in much the same way as register > variables -- i.e. the compiler does not have to implement things > that way if it is in a bad mood or the machine does not > support it. Most all machines implementing UNIX can implement readonly variables - if you can have shared text, you can probably have shared readonly data. (To do it on machines with separate I&D space with programs that use separate I&D space would require changes to UNIX, but there do exist UNIX versions with those changes.) This is also in the draft standard, although they chose "const" instead of "readonly", possibly to make it compatible with the syntax used in Bell Labs' C++ language. "const" is actually fancier than, say "static", in that you can have a "pointer to const XXX" as well as a "const pointer to XXX"; presumably, this is so the compiler can detect code that tries to modify "const" variables (an oxymoron?) at compile time. I suspect it works as you suggest - i.e., an implementation can ignore it if it chooses. Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy