Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!oliveb!sun!gorodish!guy From: guy%gorodish@Sun.COM (Guy Harris) Newsgroups: comp.lang.c Subject: Re: Types Message-ID: <19527@sun.uucp> Date: Fri, 22-May-87 00:55:38 EDT Article-I.D.: sun.19527 Posted: Fri May 22 00:55:38 1987 Date-Received: Sat, 23-May-87 14:28:06 EDT References: <7264@brl-adm.ARPA> <734@sdchema.sdchem.UUCP>, <293@osupyr.UUCP> <533@l.cc.purdue.edu> Sender: news@sun.uucp Lines: 45 > 1. Have the compiler substitute locations in -asm- statements. > Other than editing the assembler output, I do not believe there > is any way to insert asm statements which can be expected to > survive a change from one compiler to another. This isn't a C language *specification* issue. This is a C *implementation* issue. Some implementations, such as the AT&T WE32K series implementation, support this. It's not clear that a language specification can include something like this, since the specifiers generally can't predict in advance what sort of machines the language will be implemented on. > 3. Allow the programmer to force non-promotion of floating to double, > whenever the programmer feels there is a good reason to do this. Go read the ANSI C draft standard; it no longer requires floating point arithmetic to be done in double precision. > 4. Allow floating point numbers to be given in hex. Try putting in > 2^-32 as a floating point or double constant. Why should one have to > risk computer roundoff when it is totally unnecessary? If you really must do this, you can do it with a union. (Yes, this may be inconvenient. Life is full of little inconveniences.) > 5. Require that the compiler honor parentheses. When I want a > subroutine to return (x - y - k*c) + f(y), I most emphatically do > not want the compiler to do the "obvious" rearrangement to combine > the two terms with y; this can be a major loss of accuracy. No! When a system programmer writes some expression involving several macros, all of which perform arithmetic on their arguments, and some subset of those arguments are constant, they most emphatically want the compiler to do as much of the computation at compile time as possible, even if this means rearranging the expression. Perhaps the rules for rearrangement should be different for integral and floating-point operations, but it would be a serious mistake to change C for the benefit of people doing heavy floating-point computation if that makes it handle integer and pointer arithmetic less efficiently. Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com