Possible egcs-980115 bug handling pointer casts
Jason Merrill
jason@cygnus.com
Mon Jan 26 12:28:00 GMT 1998
>>>>> John Wehle <john@feith.com> writes:
> I appreciate the information. I don't mean to be thick, and I realize
> this is getting off of the egcs-bugs topic, however a couple of last
> questions:
> 1) What are you quoting from? I couldn't find the quote in the back
> of my ANSI C K&R, or in my copy of ANSI X3.159-1989. Keep in mind
> that I talking C here, not C++.
Ah. I was talking C++. C may not have the same restrictions.
> 3) The quote says that the behavior of accessing the stored value of an
> object through an lvalue of a char or unsigned char type is defined.
> More specifically does that mean:
> int a;
> ...
> *(char *)&a = ...
> is defined, even though
> int a;
> ...
> *(short *)&a = ...
> isn't?
Yes.
Jason
More information about the Gcc-bugs
mailing list