What if no such context occurs in my program?
-
-
I'm not certain whether LD_PRELOAD (or dynamic linking in general) constitute "redefining" standard library functions according to the C standard, but that seems like another ship that has sailed in practice.
-
Ultimately, the compiler needs to make conservative assumptions about malloc() and nexttoward(). Given that C compilers today are decoupled from standard libraries, the only properties the compiler can make use of are those guaranteed by the standard.
-
In particular, the existence of a malloc impl where malloc never returns 0 when running a given program implies that the compiler cannot assume that a given "malloc fails" branch is reachable.
-
I think we just have different views here thst can't be reconciled. To me a program that depends on behavior of a particular malloc impl to satisfy invariants is simply not valid.
-
To be valid it would have to meet them with all possible mallocs.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.