News for hackers. Stuff that matters.
Re:Deconstructing K&R C Is Dead (2015) by kinkdr on Thursday May 19, 2016 @02:33AM (#11728439)
Why is it UB?

Let's say head value is "10" and the memory at "10" is {..., next: "10"}

After the first iteration we will have:

Head: "10" Next: "10" Temp: "10"

With "10" pointing to freed memory. But why do we care? We are not dereferencing it, are we?

(I think I am missing something very obvious)

Re:Deconstructing K&R C Is Dead (2015) by jacquesgt on Thursday May 19, 2016 @02:39AM (#11728467)
I think you’re missing the fact that "There are a lot of rules you need to be aware of that are not naturally-occurring results of the fundamentals."
Re:Deconstructing K&R C Is Dead (2015) by kinkdr on Thursday May 19, 2016 @02:53AM (#11728520)
I was indeed. Thanks for the insight!
Re:Deconstructing K&R C Is Dead (2015) by Arnavion on Thursday May 19, 2016 @02:37AM (#11728460)
Because the standard says even comparing a dangling pointer is UB, which was haberman's point about the standard being non-intuitive.
Re:Deconstructing K&R C Is Dead (2015) by kinkdr on Thursday May 19, 2016 @02:53AM (#11728519)
Thanks. I wasn't aware of that. I stand corrected!!