Better HN
topnewbestaskshowjobs
Log inSign up

hnfairy

3 karma · joined Dec 26, 2016 (9y ago) · 1 submissions

Submissions

comment 9y ago · link · parent

Despite the argument at the end, this is undefined behavior in the latest C specification. The code dereferences a pointer one past the last element.

C11 6.5.6/8:

If the result points one past the last element of the array object, it shall not be used as the operand of a unary * operator that is evaluated