Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!mit-eddie!genrad!decvax!decwrl!pyramid!prls!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.c Subject: Re: Types Message-ID: <820@mcgill-vision.UUCP> Date: Mon, 22-Jun-87 23:17:44 EDT Article-I.D.: mcgill-v.820 Posted: Mon Jun 22 23:17:44 1987 Date-Received: Sat, 27-Jun-87 04:48:19 EDT References: <7264@brl-adm.ARPA> <734@sdchema.sdchem.UUCP>, <293@osupyr.UUCP> <541@l.cc.purdue.edu> Organization: McGill University, Montreal Lines: 54 In article <541@l.cc.purdue.edu>, cik@l.cc.purdue.edu (Herman Rubin) writes: [various stuff about problems with C] >>> 2. Require that the compiler honor, whenever possible, assignments >>> to registers. ^^^^^^^^ >> Is this really a problem? Maybe I've been luckly, but when I ask >> for a register I get it provided I haven't used them all yet. > On the VAX, the compiler only lets me use half of the registers, and > [other "problems"] Sorry. For the compilers you were using, it's not possible. If you want full control over allocation of all the machine's registers (or even any control over any of them), you don't want standard C. >>> 3. [...] Also, on some machines, one cannot print out a floating >>> number in hex. >>> 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? >> Some people have noted that this might be a niece feature, I forget >> what if any problems there are with this. > There are no problems with this, but I do not know of any notation > that has been suggested to do this. There is a problem with both of those: suppose floating-point is not stored in a binary format - say it uses floating-point ternary? Suppose the machine uses packed decimal? Suppose you figure out your hex constant for your VAX and then have to port to your Sun? Then to your 80x86? Then to your IBM mainframe? Then to that packed decimal machine I mentioned? Yech. Just write 1/65536.0/65536.0 and let the compiler figure it out. >>> 5. Require that the compiler honor parentheses. Not this again, just when we thought it had been beaten to death.... >>> [...] (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; >> What two terms with y? I hope my C compiler doesn't think y can be >> factor out of that expression to form (f-1)(y) :-). > The two terms are -y and f(y). What would you think the "obvious" rearrangement would merge -y and f(y) to form? I fear the "obvious" rearrangement isn't obvious to me. The only thing that looks anything like reasonable was the >> suggestion of (f-1)(y), and even that is pretty silly. Or do you mean you don't want it to generate (x-k*c)+(f(y)-y)? Sorry, again, you don't want standard C (though ANSI has unary +, which could be used to "solve" this particular "problem"). der Mouse (mouse@mcgill-vision.uucp)