Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!psuvax1!psuvm!cmh117 From: CMH117@psuvm.psu.edu (Charles Hannum) Newsgroups: comp.lang.c Subject: Re: Passing functions in C Message-ID: <90072.144530CMH117@psuvm.psu.edu> Date: 13 Mar 90 19:45:30 GMT References: <1990Mar9.045151.9601@ucselx.sdsu.edu> <3242@hcx1.SSD.CSD.HARRIS.COM> <3243@hcx1.SSD.CSD.HARRIS.COM> Distribution: usa Organization: Penn State University Lines: 31 In article <3243@hcx1.SSD.CSD.HARRIS.COM>, brad@SSD.CSD.HARRIS.COM (Brad Appleton) says: > >incidentally, that brings up an interesting point! If I have a function > > int foo() { int i; i = 10; } > >without a specified return value, what will be returned when foo is called. >On one compiler I have used, it will return "10" because 10 was the last >"thing that was evaluated". I doubt that this is reliable however (is it?) > >Should the compiler catch the "missing return" or is that left strictly >to lint? Old style C compilers that did not support the void type simply used int functions that didn't return a value. Thus, out of habit, some compilers *still* don't catch missing return values. There should at least be a warning you can turn on that will catch this, though you should be able to turn it off when working with old C programs. >advTHANXance Cute. Virtually, - Charles Martin Hannum II "Klein bottle for sale ... inquire within." (That's Charles to you!) "To life immortal!" cmh117@psuvm.{bitnet,psu.edu} "No noozzzz izzz netzzzsnoozzzzz..." c9h@psuecl.{bitnet,psu.edu} "Mem'ry, all alone in the moonlight ..."