Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: why is free() a void? Message-ID: <14365@smoke.brl.mil> Date: 7 Nov 90 09:04:05 GMT References: <1749@meaddata.meaddata.com> <1990Oct24.211905.225@Neon.Stanford.EDU> <2604@cirrusl.UUCP> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 15 In article <2604@cirrusl.UUCP> dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) writes: >Both free() and (*handler)() used to return int at one time. They certainly did not. Before the "void" type was added to the C language, the only way to declare or define a function that didn't return a value was to just omit its return type. Unfortunately, as a programmer convenience the common type "int" was also permitted to be elided in many declarations, including as the return type for a function declaration/definition. Thus, an actually-void function had type indistinguishable from function-returning-int. After "void" was added, we cleaned up this overloading. Old-style actually-void function code for the most part will continue to work, signal handlers being the notable exception. (And even they generally continue to work in nearly all implementations.)