This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Bradley Lucier writes:
So it comes down to a quality of implementation question. You're saying that my "implementation defined" code is clearly wrong, and everyone else's "implementation defined" conversion between pointers and ints is OK; I have yet to be convinced.
I don't understand your point. If it is true, as I maintain, that performing arithmetic on an int* and then using the resulting pointer as a double* is undefined, then the code you present is undefined.
7 A pointer to an object or incomplete type may be converted to a pointer to a different object or incomplete type. If the resulting pointer is not correctly aligned 57) for the pointed-to type, the behavior is undefined. Otherwise, when converted back again, the result shall compare equal to the original pointer. When a pointer to an object is converted to a pointer to a character type, the result points to the lowest addressed byte of the object. Successive increments of the result, up to the size of the object, yield pointers to the remaining bytes of the object.
That isn't a quality of implementation issue: the code in question simply doesn't mean anything.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |