News for hackers. Stuff that matters.
Re:Undefined behavior is often a thing for C programmers (2011) by abainbridge on Thursday September 03, 2020 @12:10PM (#24365500)
> The reasons for that are performance. So that one doesn't have to assume everything aliases everything else.

Can you expand on that? I don't understand.

Edit: I see the answer in one of your other comments:

> If len and array are both of the same type then the compiler must assume they can alias (or one of them is char*). One has to explicitly state with restrict that they cannot alias.

I'd happily take that hit. I can put restrict in the hot paths of my code. I'm tempted to say I want restrict to be the default, but I haven't thought that through.

There are no comments on this comment yet.