Path: utzoo!attcan!uunet!pilchuck!dataio!fnx!nazgul!bright From: bright@nazgul.UUCP (Walter Bright) Newsgroups: comp.lang.c Subject: Re: why is free() a void? Message-ID: <149@nazgul.UUCP> Date: 8 Nov 90 18:42:11 GMT References: <1749@meaddata.meaddata.com> <130@nazgul.UUCP> <5241@ima.ima.isc.com> Reply-To: bright@nazgul.UUCP (Walter Bright) Organization: Zortech, Seattle Lines: 19 In article <5241@ima.ima.isc.com> karl@ima.isc.com (Karl Heuer) writes: /In article <130@nazgul.UUCP> bright@nazgul.UUCP (Walter Bright) writes: />Thus, it became apparent that the abort should be moved inside of free(). />That's what the Zortech free function does now, if it detects a corrupted />heap it prints the message: /> "Heap is corrupted" />and immediately terminates the program. free() now returns a void. /Good for you. I hope you die with abort() or equivalent rather than exit() /(even if the distinction is minor under DOS); then you can answer the diehards /by telling them to trap SIGABRT. No, the function exits immediately to DOS, it does not pass Go and does not collect $200. My reasoning is that the program *has already crashed* and must be stopped *as soon as possible* to avoid corrupting the FAT or some other critical area. The library source comes with the Developer's Edition, and if someone wishes to change this behavior, it would not be very difficult. But someone doing this I think would need a very good reason for it.