Re: Certified C compilers for safety-critical embedded systems

From: Alex Colvin (alexc_at_std.com)
Date: 12/29/03


Date: Mon, 29 Dec 2003 21:13:34 +0000 (UTC)


>[...]
>>The C standard explicitly permits accessing one element beyond the end

not exactly. it permits addressing one beyond the end, but not accessing
so
        int a[10], *after = &a[10];
is OK, but
        a[10]++
isn't

The rule lets you do bounds checks on pointers, even with empty ranges.

-- 
	mac the naïf