Replying to @andreasdotorg
That’s a good one and valid, but not one of the bugs anyone else has brought up 😂. Besides, having bugs isn’t the issue. Resolving, reducing, and remaining well architected is the point.
1
2
You’re unable to view this Post because this account owner limits who can view their Posts.
Yeah no one is disagreeing. Ignoring better options isn’t the point. Acknowledging that good architecture is a choice is. It isn’t really “harder” now, either. In fact it’s easier today to write safe C than ever before. We know more & have better tools/OS guards. It’s easy now :)
1
3
You’re unable to view this Post because this account owner limits who can view their Posts.
I’m one of the best when it comes to finding 0day in C. :) but I know it’s easy now, to write safe C. You can disagree all you want, but the tools and mitigation’s are available. Our industry failure is not making access simple and straight forward.
2
1
You’re unable to view this Post because this account owner limits who can view their Posts.
I might be in the zero category. What seems to be the problem? Is it that in the function declaration foo pointer is not declared const? Or is SIZE the problem?
1
You’re unable to view this Post because this account owner limits who can view their Posts.
you sure you understand your own example? :) there's no UB in your code because 1. the multiplication is done in size_t (due to sizeof), 2. the int->size_t conversion is well defined, 3. the size_t->int conversion is implementation defined.
1
You’re unable to view this Post because this account owner limits who can view their Posts.
no, it's not, the two are very different. one results in a defined program, the other does not. now whether you like the resulting defined behaviour is another question which is why programmers have the task of, well, doing their job and write programs with desirable behaviour :)

May 4, 2018 · 10:48 AM UTC