2:28 AM
@AlexisKing If language #1 can perform a task without impediments that are present in language #2, that would suggest that unless language #2 has some other huge advantages, language #1 is likely more suitable for that task and that the impediments in language #2 are unnecessary.
The C Standard was written to describe an already existing family of dialects. Many such dialects could process the malloc
function in K&R2 without needing any adaptation beyond configuration for the system's alignment requirements and variations in the ways of acquiring large chunks of storage from the system which should then be subdivided at the application level. Commecial compilers make no attempt to perform optimization which would break with that, but ...
...clang and gcc look for places where it can recognize that pointers happen to be equal, without regard for whether they've been converted through different types, thus meaning that any storage which has ever been used as a particular type can never be used within its lifetime as anything else.