Comment by nh2

Comment by nh2 10 months ago

0 replies

> There are many cases where the one calling malloc cannot be the one calling free and must explicitly document

That's fine. Special cases, documented deviation from the default convention.

> one cannot rely on file descriptors being closed without errors in practice, so people don't

You mean "so people don't call close(), and the error gets swallowed" (like the article points out for `cat`)? How's that good? Why is improving that "no benefit"?

> you can't just repave decades of infrastructure

Of course you can.

There are also lots of projects that were written without checking the return value of malloc() and then crashing. People make PRs and those get fixed.

Similarly people can come to the conclusion that LLVM and cat should call close() to not swallow errors, and then it will be done.