Messages in this thread | | | From | dewar@gnat ... | Subject | Re: [PATCH] C undefined behavior fix | Date | Wed, 2 Jan 2002 19:49:16 -0500 (EST) |
| |
<<At the risk of going off topic, you can take the non-element's address but you can't actually touch it. So provided your architecture supports pointer arithmetic beyond the end of the segment, your only remaining worries are (1) that you don't stumble into the NULL address (which need not be zero), and (2) that the address isn't reused as a valid element of something else. I'm not so sure the latter is even a requirement. >>
Ah! But you can compare it, and on a segmented architecture like the 286, the address just past the end of the array can wrap to zero if the array is allocated right up to the end of the segment. This is not theory, at least one C compiler on the 286 had this bug! - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |