Newsgroups: comp.arch Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Re: 80486 vs. 68040 code size [really: how many regs] Message-ID: <1989Jun3.232558.5303@utzoo.uucp> Organization: U of Toronto Zoology References: <19063@winchester.mips.COM> <670005@hpmwjaa.HP.COM> Date: Sat, 3 Jun 89 23:25:58 GMT In article <670005@hpmwjaa.HP.COM> jeffa@hpmwtd.HP.COM (Jeff Aguilera) writes: >> And then there are the sloppy programmers, the >> ones who assume (as you mention) that pointers and ints are the same size, >> or that ints are 32 bits, or that ints and longs are the same size... > >This is a problem with poor language design, not sloppy programming. C >provides no means for a programmer to express the intended range of an >integer... Actually, what we have here is sort of a borderline case, which can be viewed either way depending on your prejudices. As in so many other things, C provides tools rather than solutions, and trusts the programmer to use them properly. Remember, C is interested in efficiency as well as ease of expression. It isn't always easy for a simple compiler to go from intended ranges to efficient code, and it often isn't obvious from the source just how efficient the code is going to be. There can also be problems if you want the code to be portable and to run the hardware as efficiently as possible on multiple machines: sometimes you really do want to say "as big an integer as this machine supports efficiently". Also, I don't see how the express-the-range argument entirely addresses the issues I raised. Whether or not C could be better, the programmers are supposed to be coding in C, not Pascal. Sloppiness is sloppiness, regardless of what inspires it. -- You *can* understand sendmail, | Henry Spencer at U of Toronto Zoology but it's not worth it. -Collyer| uunet!attcan!utzoo!henry henry@zoo.toronto.edu