Path: utzoo!attcan!uunet!van-bc!ubc-cs!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!tymix!cirrusl!sunfire!dhesi From: dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) Newsgroups: comp.lang.c Subject: Re: why is free() a void? Message-ID: <2604@cirrusl.UUCP> Date: 25 Oct 90 17:21:30 GMT References: <1749@meaddata.meaddata.com> <1990Oct24.211905.225@Neon.Stanford.EDU> Sender: news@cirrusl.UUCP Lines: 17 >>...I'm curious as to why free() does not return a value. Yes, free() could legitimately return an error code if it detected something wrong. A debugging version of the memory allocation library could always have free() return a useful value, and even production versions could sometimes return an error indication. Also, a signal handler (*handler)() installed by signal() could legitimately return a status code for use by the kernel. Both free() and (*handler)() used to return int at one time. The availability of the `void' data type, and a certain religious desire to be "pure", seem to have made both functions now return nothing. It's a loss. -- Rahul Dhesi UUCP: oliveb!cirrusl!dhesi