Xref: utzoo comp.lang.c:22152 comp.unix.ultrix:1762 Path: utzoo!attcan!utgpu!watmath!att!dptg!rutgers!tut.cis.ohio-state.edu!unmvax!bbx!bbxsda!scott From: scott@bbxsda.UUCP (Scott Amspoker) Newsgroups: comp.lang.c,comp.unix.ultrix Subject: Re: Type of expression sizeof(x) Message-ID: <145@bbxsda.UUCP> Date: 21 Sep 89 22:31:57 GMT References: <256@servio.UUCP> Reply-To: scott@bbxsda.UUCP (Scott Amspoker) Organization: Basis International, Albuquerque, NM Lines: 23 In article <256@servio.UUCP> penneyj@servio.UUCP (D. Jason Penney) writes: >I am posting this quirk to comp.lang.c because I would be VERY interested to >hear (by e-mail, please) from anyone who thinks that this is acceptable >behavior. > >Our conversation with DEC re this bug was extremely unhelpful. They claim that >the return type of a sizeof() expression is system-dependent. Somewhere along the way sizeof() became unsigned. We had few loops that blew up but it was easy enough to fix. I'm not sure where we got the notion that sizeof() was an int - but apparently a lot of developers got the same notion. I figured that part of the problem was those 64K segmented, 16-bit integer processors. In order to allow an array greater than 32k, sizeof() had to be unsigned (or long). I hope the ANSI draft doesn't leave this as "implementation dependent". Some idiot implementor somewhere will make sizeof() return float. -- Scott Amspoker Basis International, Albuquerque, NM (505) 345-5232