Xref: utzoo comp.lang.c:8808 comp.unix.wizards:7521 Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!pacbell!ptsfa!lll-tis!lll-winken!lll-lcc!pyramid!nsc!taux01!amos From: amos@taux01.UUCP (Amos Shapir) Newsgroups: comp.lang.c,comp.unix.wizards Subject: Re: ANSIfication of 4BSD Message-ID: <546@taux01.UUCP> Date: 3 Apr 88 13:50:09 GMT References: <10830@mimsy.UUCP> Organization: National Semiconductor (Israel) Ltd. Home of the 32532 Lines: 35 Hdate: 16 Nisan 5748 The bugs that men do live on after them... This is an interesting suggestion, since I did have the chance to make such changes, and one of them - signed sizeof - is my own idea. Because of #4 in Chris' article (persistence of unsigned-ness), when I was converting PCC to the tahoe at CCI, I made the decision to implement #3 (signed sizeof); originally sizeof was unsigned. The chain of events leading to that decision is rather interesting, and may teach us something (though I'm not sure what): - The first version of the machine had no FPU; - When the FPU was put in, it was discovered that there was no more room in the microcode storage, and some integer instructions had to go; - The least used instructions were unsigned mod (and div? I forget); - Replacing them required using the 'ediv' instruction, which was not used or tested much till then; - When ediv was brought into frequent use, a bug was discovered in its interaction with the page-fault mechanism; - Since there was no time to fix it, a work-around was used, which required putting all operands in registers; - Complicated expressions involving unsigned terms ran out of registers and caused 'simplify expression' messages; - Many such expressions were generated by sizeof, which caused conversion to unsigned of the whole expression, even if all other terms were signed; - Since the machine architecture itself limits sizes of objects to 1Gb, there was no point not to change sizeof to int. About *void: I totally agree, I would have put it in myself if it was standard then (1982). -- Amos Shapir (My other cpu is a NS32532) National Semiconductor (Israel) 6 Maskit st. P.O.B. 3007, Herzlia 46104, Israel Tel. +972 52 522261 amos%taux01@nsc.com 34 48 E / 32 10 N