|
|
|
|
|
by amelius
3461 days ago
|
|
I think the authors of the spec really meant something else: reading/writing a memory location past the end of the array is illegal. But here "*" is used only in an address computation, not to actually access memory. Shows how difficult it is to get a spec right. So, IMO, you are right, the code in the article is illegal (strictly speaking). But I think it is likely that most compilers would still allow it, because that clause in the spec essentially exempts the compiler from adding an explicit bounds check. |
|