Path: utzoo!mnetor!uunet!nuchat!splut!jay From: jay@splut.UUCP (Jay Maynard) Newsgroups: comp.lang.c Subject: Re: Long Chars Message-ID: <439@splut.UUCP> Date: 22 Mar 88 12:52:09 GMT References: <7447@brl-smoke.ARPA> Organization: Confederate Microsystems, League City, TX Lines: 23 From article <7447@brl-smoke.ARPA>, by gwyn@brl-smoke.ARPA (Doug Gwyn ): > [...] Its only problem is that a fair amount of code has been > written dependent on the assumption that sizeof(char)==1, although > some programmers have been careful not to assume that all along. My initial knee-jerk reaction to this was "Hey, wait a minute! sizeof(char) is defined to be 1!" Before I made a fool of myself on the net (wouldn't be the first time...:-), though, I picked up the copy of K&R that my recent desk-cleaning revealed. Sure enough, section 7.2, at the top of page 188 in my copy, says: "A _byte_ is undefined in the language except in terms of the value of sizeof. However, IN ALL EXISTING IMPLEMENTATIONS a byte is the space required to hold a char." (Emphasis added.) I don't know how much existing code this would break (though I'd bet there would be quite a bit of it). It does mean that I, too, will be careful not to make that assumption... -- Jay Maynard, EMT-P, K5ZC...>splut!< | GEnie: JAYMAYNARD CI$: 71036,1603 uucp: {uunet!nuchat,academ!uhnix1,{ihnp4,bellcore,killer}!tness1}!splut!jay Never ascribe to malice that which can adequately be explained by stupidity. The opinions herein are shared by none of my cats, much less anyone else.