Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think "restrict" is a really nice compromise in C: Your code declares that you're willing to follow additional rules, and the compiler can make additional optimizations.

The article shows a piece of code that makes that promise and then doesn't hold up its part of the agreement. I can't even follow the rest of the argument from there because it's all based on a faulty foundation.



> The article shows a piece of code that makes that promise and then doesn't hold up its part of the agreement.

Edit: disregard; I now see your other comments.

Incorrect. The article shows a piece of code that makes and fulfills that promise, and then the optimization passes break the code. If you disagree, I would be interested in hearing how/where you think the code itself is faulty.


No, I was sloppy when I read it the first time. The second snippet of code is broken, and I (incorrectly) assumed it was a valid translation from the first snippet. My bad.

The first snippet is subtle, and I'm not a language lawyer, but I can't see anything that screams "contract violation".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: