Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 23 May 2011 23:19:01 -0500 Message-ID: <4DDB31B5.2795@mindspring.com> Date: Tue, 24 May 2011 00:19:01 -0400 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: Types in C References: <43d4ef5f7d2b0f9-0f635@gmail.com> <9401m9Ft2pU9@mid.individual.net> <50d915539d62563-19304@gmail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 37 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.219.57 X-Trace: sv3-D59vxJ+iiH4yy520UXHz5DtAXePCTuU8NnMJXevdSDq8/lXp7FV5s8Sr5MX+iW0HHrOeiGgeoV3f6D4!9fAIy56V1qTsj6wEpxX3h2kyv4oYGeNzkJkVcQgQF+Q6zLP7KmWYdkQsWTxAd3V2fgV0xWkZvwYg!Oo5cli9Ifw== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2396 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:4664 Uncle Steve wrote: > > On Mon, May 23, 2011 at 10:12:02PM -0500, Shao Miller wrote: > > The standard definition in C99, if I'm not mistaken, includes: > > > > "The meaning of a value stored in an > > object or returned by a function > > is determined by the /type/ of the expression used to access it..." > > Doesn't that specify when and how a cast occurs in expression > evaluation? The quoted text is not about conversions. If you have a signed char with a value of (-1) and you convert that by assignment to unsigned char, then the value in the unsigned char object will be equal to UCHAR_MAX, on any computer. signed char minus_one = -1; unsigned char max = minus_one; That's conversions. But, if you access minus_one as an unsigned char unsigned char access_value = *(unsigned char *)&minus_one; then the value of access_value may or may not be something different from UCHAR_MAX, depending on the representation of ((signed char)-1). That's not conversions. -- pete