Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!crdgw1!camelback!volpe From: volpe@camelback.crd.ge.com (Christopher R Volpe) Newsgroups: comp.lang.c Subject: Re: strcmp Message-ID: <20800@crdgw1.crd.ge.com> Date: 21 Jun 91 17:54:48 GMT References: <1991Jun18.153653.1494@zoo.toronto.edu> <14421@dog.ee.lbl.gov> <14498@dog.ee.lbl.gov> <6476.Jun2023.30.3491@kramden.acf.nyu.edu> Sender: news@crdgw1.crd.ge.com Reply-To: volpe@camelback.crd.ge.com (Christopher R Volpe) Lines: 23 In article <6476.Jun2023.30.3491@kramden.acf.nyu.edu>, brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: |>On the other hand, how can sizeof(char) == sizeof(int)? I was under the |>impression that sizeof(char) had to be smaller than sizeof(int). |>Otherwise the getchar() interface explodes. I know of at least one architecture where sizeof(char)==sizeof(int) == 32 bits. (Although the only compiler for it that I'm aware of is freestanding.) All that's required is that sizeof(char) be no bigger than sizeof(int). This won't break the getchar() interface, I believe, because getchar() doesn't necessarily have to return all values of type char. It has to return all characters in the machine's basic character set, plus EOF. So on this machine the bit patterns for char values -1 through 255 would all be distinct. -Chris |> |>---Dan ================== Chris Volpe G.E. Corporate R&D volpecr@crd.ge.com